test262/test/built-ins/Atomics/load/shared-nonint-views.js

21 lines
565 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.load
description: >
Test Atomics.load on shared non-integer TypedArrays
includes: [testTypedArray.js]
features: [Atomics, TypedArray]
---*/
var sab = new SharedArrayBuffer(1024);
var other_views = [Uint8ClampedArray, Float32Array, Float64Array];
testWithTypedArrayConstructors(function(View) {
var view = new View(sab);
assert.throws(TypeError, (() => Atomics.load(view, 0)));
}, other_views);