Source code
Revision control
Copy as Markdown
Other Tools
// Copyright (C) 2020 Rick Waldron. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-atomics.load
description: >
Atomics.load throws when operating on incompatible TypedArrays
includes: [testTypedArray.js]
features: [ArrayBuffer, Atomics, TypedArray]
---*/
testWithNonAtomicsFriendlyTypedArrayConstructors((TA, makeCtorArg) => {
const buffer = makeCtorArg(4);
const view = new TA(buffer);
assert.throws(TypeError, function() {
Atomics.load(view, 0);
}, `Atomics.load(new ${TA.name}(buffer), 0) throws TypeError`);
}, ["arraybuffer"]);