fixup! Atomics.and will operate on TA when TA.buffer is not a SharedArrayBuffer

This commit is contained in:
Rick Waldron 2020-05-20 14:17:46 -04:00
parent 9e7b4e733d
commit e1c71a65e2
3 changed files with 4 additions and 4 deletions

View File

@ -13,4 +13,4 @@ const i64a = new BigInt64Array(
);
assert.sameValue(Atomics.and(i64a, 0, 1n), 0n);
assert.sameValue(Atomics.load(i64a, 0), 1n);
assert.sameValue(Atomics.load(i64a, 0), 0n);

View File

@ -14,6 +14,6 @@ const buffer = new ArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * 4);
testWithNonShareableBigIntTypedArrayConstructors(function(TA) {
const view = new TA(buffer);
assert.throws(TypeError, function() {
Atomics.and(view, 0, 1);
}, `Atomics.and(new ${TA.name}(buffer), 0, 1) throws TypeError`);
Atomics.and(view, 0, 1n);
}, `Atomics.and(new ${TA.name}(buffer), 0, 1n) throws TypeError`);
});

View File

@ -9,7 +9,7 @@ includes: [testTypedArray.js]
features: [ArrayBuffer, Atomics, TypedArray]
---*/
const buffer = new ArrayBuffer(16);
const buffer = new ArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4);
testWithNonSharableTypedArrayConstructors(function(TA) {
const view = new TA(buffer);