2018-04-25 23:29:53 +02:00
|
|
|
// Copyright (C) 2018 Rick Waldron. All rights reserved.
|
|
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
|
|
|
|
|
|
|
/*---
|
|
|
|
esid: sec-atomics.store
|
|
|
|
description: >
|
|
|
|
Test range checking of Atomics.store on arrays that allow atomic operations
|
|
|
|
includes: [testAtomics.js, testBigIntTypedArray.js]
|
|
|
|
features: [ArrayBuffer, arrow-function, Atomics, BigInt, DataView, for-of, let, SharedArrayBuffer, TypedArray]
|
|
|
|
---*/
|
|
|
|
|
2018-06-26 21:01:53 +02:00
|
|
|
var buffer = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 2);
|
2018-04-25 23:29:53 +02:00
|
|
|
|
|
|
|
testWithBigIntTypedArrayConstructors(function(TA) {
|
|
|
|
let view = new TA(buffer);
|
|
|
|
testWithAtomicsOutOfBoundsIndices(function(IdxGen) {
|
2018-05-18 21:00:10 +02:00
|
|
|
assert.throws(RangeError, function() {
|
|
|
|
Atomics.store(view, IdxGen(view), 10);
|
|
|
|
}, 'Atomics.store(view, IdxGen(view), 10) throws RangeError');
|
2018-04-25 23:29:53 +02:00
|
|
|
});
|
|
|
|
});
|