Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Atomics/load/nonshared-int-views.js

raw
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.load
6 description: >
7 Test Atomics.load on non-shared integer TypedArrays
8 includes: [testTypedArray.js]
9 features: [TypedArray]
10 ---*/
11
12 var ab = new ArrayBuffer(16);
13
14 var int_views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
15
16 if (typeof BigInt !== "undefined") {
17 int_views.push(BigInt64Array);
18 int_views.push(BigUint64Array);
19 }
20
21 testWithTypedArrayConstructors(function(View) {
22 var view = new View(ab);
23
24 assert.throws(TypeError, (() => Atomics.load(view, 0)));
25 }, int_views);