Backed out 3 changesets (bug 1892041) for causing failures on async-module-does-not...
[gecko.git] / js / src / tests / test262 / built-ins / Atomics / store / bigint / bad-range.js
blobe7dd5520ced908258c13aaa49e1d5cbc74492b09
1 // |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration('arm64-simulator'))) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics
2 // Copyright (C) 2018 Rick Waldron. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
4 /*---
5 esid: sec-atomics.store
6 description: >
7   Test range checking of Atomics.store on arrays that allow atomic operations
8 includes: [testAtomics.js, testBigIntTypedArray.js]
9 features: [ArrayBuffer, Atomics, BigInt, DataView, SharedArrayBuffer, Symbol, TypedArray]
10 ---*/
11 const buffer = new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * 2);
13 testWithBigIntTypedArrayConstructors(TA => {
14   const view = new TA(buffer);
16   testWithAtomicsOutOfBoundsIndices(function(IdxGen) {
17     assert.throws(RangeError, function() {
18       Atomics.store(view, IdxGen(view), 10n);
19     }, '`Atomics.store(view, IdxGen(view), 10n)` throws RangeError');
20   });
21 });
23 reportCompare(0, 0);