Bug 1892041 - Part 2: Update test262. r=spidermonkey-reviewers,dminor
[gecko.git] / js / src / tests / test262 / built-ins / Atomics / notify / bigint / bad-range.js
blob7c8707612a560f8148dee5b718bad751547d0401
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.
5 /*---
6 esid: sec-atomics.notify
7 description: >
8   Test range checking of Atomics.notify on arrays that allow atomic operations
9 info: |
10   Atomics.notify( typedArray, index, count )
12   1. Let buffer be ? ValidateSharedIntegerTypedArray(typedArray, true).
13   ..
15 includes: [testAtomics.js]
16 features: [ArrayBuffer, Atomics, BigInt, DataView, SharedArrayBuffer, Symbol, TypedArray]
17 ---*/
19 const i64a = new BigInt64Array(
20   new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * 8)
23 testWithAtomicsOutOfBoundsIndices(function(IdxGen) {
24   assert.throws(RangeError, function() {
25     Atomics.notify(i64a, IdxGen(i64a), 0);
26   });
27 });
29 reportCompare(0, 0);