mirror of
https://github.com/tc39/test262.git
synced 2025-07-24 22:45:10 +02:00
Update Atomics.exchange to allow non-shared buffers
Follow-up for: https://github.com/tc39/test262/pull/2633
This commit is contained in:
parent
51e73466ee
commit
836f609b08
@ -4,16 +4,16 @@
|
|||||||
/*---
|
/*---
|
||||||
esid: sec-atomics.exchange
|
esid: sec-atomics.exchange
|
||||||
description: >
|
description: >
|
||||||
Test Atomics.exchange on non-shared integer TypedArrays
|
Atomics.exchange throws when operating on non-sharable integer TypedArrays
|
||||||
includes: [testTypedArray.js]
|
includes: [testTypedArray.js]
|
||||||
features: [ArrayBuffer, Atomics, TypedArray]
|
features: [ArrayBuffer, Atomics, TypedArray]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var buffer = new ArrayBuffer(16);
|
testWithNonAtomicsFriendlyTypedArrayConstructors(TA => {
|
||||||
var views = intArrayConstructors.slice();
|
const buffer = new ArrayBuffer(TA.BYTES_PER_ELEMENT * 4);
|
||||||
|
const view = new TA(buffer);
|
||||||
|
|
||||||
testWithTypedArrayConstructors(function(TA) {
|
|
||||||
assert.throws(TypeError, function() {
|
assert.throws(TypeError, function() {
|
||||||
Atomics.exchange(new TA(buffer), 0, 0);
|
Atomics.exchange(view, 0, 0);
|
||||||
}, '`Atomics.exchange(new TA(buffer), 0, 0)` throws TypeError');
|
}, `Atomics.exchange(new ${TA.name}(buffer), 0, 0) throws TypeError`);
|
||||||
}, views);
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user