Backed out 3 changesets (bug 1892041) for causing failures on async-module-does-not...
[gecko.git] / js / src / tests / test262 / built-ins / Atomics / notify / not-a-typedarray-throws.js
blob5f9b7e2b081baa6cf33c046e6ab9e50df873a693
1 // |reftest| skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally
2 // Copyright (C) 2018 Amal Hussein. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
4 /*---
5 esid: sec-atomics.notify
6 description: >
7   Throws a TypeError if the typedArray arg is not a TypedArray object
8 info: |
9   Atomics.notify( typedArray, index, count )
11   1.Let buffer be ? ValidateSharedIntegerTypedArray(typedArray, true).
12     ...
13       3.If typedArray does not have a [[TypedArrayName]] internal slot, throw a TypeError exception.
15 features: [Atomics]
16 ---*/
18 const poisoned = {
19   valueOf: function() {
20     throw new Test262Error('should not evaluate this code');
21   }
24 assert.throws(TypeError, function() {
25   Atomics.wait({}, 0, 0, 0);
26 }, '`Atomics.wait({}, 0, 0, 0)` throws TypeError');
28 assert.throws(TypeError, function () {
29   Atomics.wait({}, poisoned, poisoned, poisoned);
30 }, '`Atomics.wait({}, poisoned, poisoned, poisoned)` throws TypeError');
32 reportCompare(0, 0);