mirror of
https://github.com/tc39/test262.git
synced 2025-04-08 19:35:28 +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
|
||||
description: >
|
||||
Test Atomics.exchange on non-shared integer TypedArrays
|
||||
Atomics.exchange throws when operating on non-sharable integer TypedArrays
|
||||
includes: [testTypedArray.js]
|
||||
features: [ArrayBuffer, Atomics, TypedArray]
|
||||
---*/
|
||||
|
||||
var buffer = new ArrayBuffer(16);
|
||||
var views = intArrayConstructors.slice();
|
||||
testWithNonAtomicsFriendlyTypedArrayConstructors(TA => {
|
||||
const buffer = new ArrayBuffer(TA.BYTES_PER_ELEMENT * 4);
|
||||
const view = new TA(buffer);
|
||||
|
||||
testWithTypedArrayConstructors(function(TA) {
|
||||
assert.throws(TypeError, function() {
|
||||
Atomics.exchange(new TA(buffer), 0, 0);
|
||||
}, '`Atomics.exchange(new TA(buffer), 0, 0)` throws TypeError');
|
||||
}, views);
|
||||
Atomics.exchange(view, 0, 0);
|
||||
}, `Atomics.exchange(new ${TA.name}(buffer), 0, 0) throws TypeError`);
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user