| 1 |
// Copyright (C) 2017 Mozilla Corporation. All rights reserved. |
| 2 |
// This code is governed by the BSD license found in the LICENSE file. |
| 3 |
|
| 4 |
/*--- |
| 5 |
esid: sec-atomics.wake |
| 6 |
description: > |
| 7 |
Test range checking of Atomics.wake on arrays that allow atomic operations |
| 8 |
includes: [testAtomics.js, testTypedArray.js] |
| 9 |
features: [SharedArrayBuffer, ArrayBuffer, DataView, Atomics, TypedArray, arrow-function, let, for-of] |
| 10 |
---*/ |
| 11 |
|
| 12 |
var sab = new SharedArrayBuffer(8); |
| 13 |
var views = [Int32Array]; |
| 14 |
|
| 15 |
if (typeof BigInt !== "undefined") { |
| 16 |
views.push(BigInt64Array); |
| 17 |
} |
| 18 |
|
| 19 |
testWithTypedArrayConstructors(function(View) { |
| 20 |
let view = new View(sab); |
| 21 |
testWithAtomicsOutOfBoundsIndices(function(IdxGen) { |
| 22 |
let Idx = IdxGen(view); |
| 23 |
assert.throws(RangeError, () => Atomics.wake(view, Idx, 0)); // Even with waking zero |
| 24 |
}); |
| 25 |
}, views); |