Debian Codegraph @

js/src/tests/test262/built-ins/Atomics/notify/count-symbol-throws.js

raw
1 // |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration('arm64-simulator'))) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics
2 // Copyright (C) 2018 Rick Waldron. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
4
5 /*---
6 esid: sec-atomics.notify
7 description: >
8 Return abrupt when symbol passed for 'count' argument to Atomics.notify
9 info: |
10 Atomics.notify( typedArray, index, count )
11
12 ...
13 3. If count is undefined, let c be +∞.
14 4. Else,
15 a. Let intCount be ? ToInteger(count).
16 ...
17
18 features: [Atomics, SharedArrayBuffer, TypedArray]
19 ---*/
20
21 const i32a = new Int32Array(
22 new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4)
23 );
24
25 assert.throws(TypeError, function() {
26 Atomics.notify(i32a, 0, Symbol());
27 });
28
29 reportCompare(0, 0);