test262/test/built-ins/Atomics/xor/nonshared-int-views.js

23 lines
627 B
JavaScript
Raw Normal View History

// Copyright (C) 2017 Mozilla Corporation. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
2017-07-26 23:49:55 +02:00
esid: sec-atomics.xor
description: >
Test Atomics.xor on non-shared integer TypedArrays
includes: [testTypedArray.js]
2018-04-19 16:11:50 +02:00
features: [ArrayBuffer, Atomics, BigInt, TypedArray]
---*/
2018-04-19 16:11:50 +02:00
var buffer = new ArrayBuffer(16);
var views = intArrayConstructors.slice();
2018-01-23 02:40:35 +01:00
if (typeof BigInt !== "undefined") {
2018-04-19 16:11:50 +02:00
views.push(BigInt64Array);
views.push(BigUint64Array);
2018-01-23 02:40:35 +01:00
}
2018-04-19 16:11:50 +02:00
testWithTypedArrayConstructors(function(TA) {
assert.throws(TypeError, (() => Atomics.xor(new TA(buffer), 0, 0)));
}, views);