summaryrefslogtreecommitdiff
path: root/test/built-ins/Atomics/wake/bad-range.js
blob: a8085f29ed55fec79a4b7ff2655a96ab66f7c36a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Copyright (C) 2017 Mozilla Corporation.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
description: >
  Test range checking of Atomics.wake on arrays that allow atomic operations
includes: [testAtomics.js]
---*/

var sab = new SharedArrayBuffer(4);
var view = new Int32Array(sab);

testWithAtomicsOutOfBoundsIndices(function(IdxGen) {
    let Idx = IdxGen(view);
    assert.throws(RangeError, () => Atomics.wake(view, Idx, 0)); // Even with waking zero
});