Atomics: fix Atomics.xor for BigInt64Array and BigUint64Array

This commit is contained in:
Rick Waldron 2018-06-26 15:34:55 -04:00
parent feab96e601
commit 64be6186be
1 changed files with 8 additions and 7 deletions

View File

@ -9,12 +9,13 @@ includes: [testAtomics.js, testBigIntTypedArray.js]
features: [ArrayBuffer, arrow-function, Atomics, BigInt, DataView, for-of, let, SharedArrayBuffer, TypedArray]
---*/
const i64a = new BigInt64Array(
new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * 8)
);
var buffer = new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * 2);
testWithAtomicsOutOfBoundsIndices(function(IdxGen) {
assert.throws(RangeError, function() {
Atomics.xor(i64a, IdxGen(i64a), 0);
}, 'Atomics.xor(i64a, IdxGen(i64a), 0) throws RangeError');
testWithBigIntTypedArrayConstructors(function(TA) {
let view = new TA(buffer);
testWithAtomicsOutOfBoundsIndices(function(IdxGen) {
assert.throws(RangeError, function() {
Atomics.xor(view, IdxGen(view), 10);
}, 'Atomics.xor(view, IdxGen(view), 10) throws RangeError');
});
});