2020-05-20 20:19:28 +02:00
|
|
|
// Copyright (C) 2017 Mozilla Corporation. All rights reserved.
|
|
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
|
|
|
|
|
|
|
/*---
|
|
|
|
esid: sec-atomics.and
|
|
|
|
description: >
|
|
|
|
Atomics.and throws when operating on non-sharable integer TypedArrays
|
|
|
|
includes: [testTypedArray.js]
|
|
|
|
features: [ArrayBuffer, Atomics, TypedArray]
|
|
|
|
---*/
|
2020-05-27 21:00:02 +02:00
|
|
|
testWithNonAtomicsFriendlyTypedArrayConstructors(TA => {
|
|
|
|
const buffer = new ArrayBuffer(TA.BYTES_PER_ELEMENT * 4);
|
2020-05-20 20:19:28 +02:00
|
|
|
const view = new TA(buffer);
|
|
|
|
|
|
|
|
assert.throws(TypeError, function() {
|
|
|
|
Atomics.and(view, 0, 1);
|
|
|
|
}, `Atomics.and(new ${TA.name}(buffer), 0, 1) throws TypeError`);
|
|
|
|
});
|