Backed out 3 changesets (bug 1892041) for causing failures on async-module-does-not...
[gecko.git] / js / src / tests / test262 / built-ins / Atomics / notify / count-tointeger-throws-then-wake-throws.js
blob69c3c39d09734150e3e2cb6170ddbd7b0a69d5ed
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.
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 )
12   ...
13   3. If count is undefined, let c be +∞.
14   4. Else,
15     a. Let intCount be ? ToInteger(count).
16   ...
18 features: [Atomics, SharedArrayBuffer, TypedArray]
19 ---*/
21 const i32a = new Int32Array(
22   new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4)
25 const poisoned = {
26   valueOf: function() {
27     throw new Test262Error('should not evaluate this code');
28   }
31 assert.throws(Test262Error, function() {
32   Atomics.notify(i32a, 0, poisoned);
33 }, '`Atomics.notify(i32a, 0, poisoned)` throws Test262Error');
35 reportCompare(0, 0);