1 // |reftest| skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally
2 // Copyright (C) 2019 André Bargull. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
8 TypedArray type is validated before `value` argument is coerced.
10 24.4.10 Atomics.sub ( typedArray, index, value )
11 1. Return ? AtomicReadModifyWrite(typedArray, index, value, sub).
13 24.4.1.11 AtomicReadModifyWrite ( typedArray, index, value, op )
14 1. Let buffer be ? ValidateSharedIntegerTypedArray(typedArray).
17 24.4.1.1 ValidateSharedIntegerTypedArray ( typedArray [ , onlyInt32 ] )
19 4. Let typeName be typedArray.[[TypedArrayName]].
20 5. If onlyInt32 is true, then
21 a. If typeName is not "Int32Array", throw a TypeError exception.
23 a. If typeName is not "Int8Array", "Uint8Array", "Int16Array", "Uint16Array", "Int32Array",
24 or "Uint32Array", throw a TypeError exception.
26 includes: [testTypedArray.js]
27 features: [Atomics, TypedArray]
32 throw new Test262Error("value coerced");
36 for (var badArrayType of nonAtomicsFriendlyTypedArrayConstructors) {
37 var typedArray = new badArrayType(new SharedArrayBuffer(8));
38 assert.throws(TypeError, function() {
39 Atomics.sub(typedArray, 0, value);