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 Amal Hussein. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
6 esid: sec-validatesharedintegertypedarray
8 Throws a TypeError if typedArray arg is not a BigInt64Array
10 Atomics.wait( typedArray, index, value, timeout )
12 1.Let buffer be ? ValidateSharedIntegerTypedArray(typedArray, true).
16 ValidateSharedIntegerTypedArray(typedArray [ , waitable ] )
19 5. If waitable is true, then
20 a. If typeName is not "BigInt64Array",
21 throw a TypeError exception.
23 features: [Atomics, BigInt, SharedArrayBuffer]
26 const i64a = new BigUint64Array(
27 new SharedArrayBuffer(BigUint64Array.BYTES_PER_ELEMENT)
32 throw new Test262Error('should not evaluate this code');
36 assert.throws(TypeError, function() {
37 Atomics.wait(i64a, 0, 0n, 0);
40 assert.throws(TypeError, function() {
41 Atomics.wait(i64a, poisoned, poisoned, poisoned);