test262/test/built-ins/Atomics/xor/bad-range.js

21 lines
708 B
JavaScript
Raw Normal View History

// Copyright (C) 2017 Mozilla Corporation. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
2017-07-26 23:49:55 +02:00
esid: sec-atomics.xor
description: >
Test range checking of Atomics.xor on arrays that allow atomic operations
includes: [testAtomics.js, testTypedArray.js]
features: [ArrayBuffer, arrow-function, Atomics, DataView, for-of, let, SharedArrayBuffer, TypedArray]
---*/
2018-01-23 02:40:35 +01:00
var sab = new SharedArrayBuffer(8);
2018-04-19 16:11:50 +02:00
var views = intArrayConstructors.slice();
2018-04-19 16:11:50 +02:00
testWithTypedArrayConstructors(function(TA) {
let view = new TA(sab);
testWithAtomicsOutOfBoundsIndices(function(IdxGen) {
2018-04-19 16:11:50 +02:00
assert.throws(RangeError, () => Atomics.xor(view, IdxGen(view), 0));
});
}, views);