Debian Codegraph @

js/src/tests/test262/built-ins/Atomics/notify/count-tointeger-throws-then-wake-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 ToInteger throws an exception on '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 const poisoned = {
26 valueOf: function() {
27 throw new Test262Error('should not evaluate this code');
28 }
29 };
30
31 assert.throws(Test262Error, function() {
32 Atomics.notify(i32a, 0, poisoned);
33 });
34
35 reportCompare(0, 0);