blob: 71515fcf878954d92d3535045ed9060cc023a0ba (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
// Copyright (C) 2017 Mozilla Corporation. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-atomics.xor
description: >
Test range checking of Atomics.xor on arrays that allow atomic operations
includes: [testAtomics.js, testTypedArray.js]
---*/
var sab = new SharedArrayBuffer(4);
var views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
testWithTypedArrayConstructors(function(View) {
let view = new View(sab);
testWithAtomicsOutOfBoundsIndices(function(IdxGen) {
let Idx = IdxGen(view);
assert.throws(RangeError, () => Atomics.xor(view, Idx, 0));
});
}, views);
|