Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Copyright (C) 2020 Jordan Harband. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
esid: sec-atomics.store
description: >
Atomics.store calls ToInteger, which normalizes -0 to +0
features: [Atomics, SharedArrayBuffer, TypedArray]
---*/

const i32a = new Int32Array(
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4)
);

assert.ok(
Object.is(
Atomics.store(i32a, 0, -0),
+0
),
'Atomics.store(i32a, 0, -0) normalizes -0 to +0'
);
assert.sameValue(
i32a[0],
+0,
'The value of i32a[0] is normalized to +0'
);