2018-04-24 20:11:32 +02:00
|
|
|
// Copyright (C) 2017 Mozilla Corporation. All rights reserved.
|
|
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
|
|
|
|
|
|
|
/*---
|
2018-06-28 22:28:03 +02:00
|
|
|
esid: sec-atomics.wait
|
2018-04-24 20:11:32 +02:00
|
|
|
description: >
|
2018-06-28 22:28:03 +02:00
|
|
|
Test range checking of Atomics.wait on arrays that allow atomic operations
|
2018-04-24 20:11:32 +02:00
|
|
|
info: |
|
|
|
|
Atomics.wait( typedArray, index, value, timeout )
|
|
|
|
|
|
|
|
1. Let buffer be ? ValidateSharedIntegerTypedArray(typedArray, true).
|
|
|
|
...
|
|
|
|
|
2018-04-25 23:29:53 +02:00
|
|
|
includes: [testAtomics.js]
|
2018-04-25 17:33:53 +02:00
|
|
|
features: [ArrayBuffer, arrow-function, Atomics, DataView, for-of, let, SharedArrayBuffer, TypedArray]
|
2018-04-24 20:11:32 +02:00
|
|
|
---*/
|
|
|
|
|
2018-05-21 20:55:47 +02:00
|
|
|
const i32a = new Int32Array(
|
2018-06-25 21:17:45 +02:00
|
|
|
new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 8)
|
2018-05-21 20:23:15 +02:00
|
|
|
);
|
2018-04-24 20:11:32 +02:00
|
|
|
|
2018-04-25 23:29:53 +02:00
|
|
|
testWithAtomicsOutOfBoundsIndices(function(IdxGen) {
|
2018-05-18 21:00:10 +02:00
|
|
|
assert.throws(RangeError, function() {
|
|
|
|
Atomics.wait(i32a, IdxGen(i32a), 0, 0);
|
2018-06-27 18:58:02 +02:00
|
|
|
}, '`Atomics.wait(i32a, IdxGen(i32a), 0, 0)` throws RangeError');
|
2018-04-25 23:29:53 +02:00
|
|
|
});
|