summaryrefslogtreecommitdiff
path: root/test/built-ins/Atomics/sub/nonshared-int-views.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/built-ins/Atomics/sub/nonshared-int-views.js')
-rw-r--r--test/built-ins/Atomics/sub/nonshared-int-views.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/built-ins/Atomics/sub/nonshared-int-views.js b/test/built-ins/Atomics/sub/nonshared-int-views.js
new file mode 100644
index 000000000..f73d0469d
--- /dev/null
+++ b/test/built-ins/Atomics/sub/nonshared-int-views.js
@@ -0,0 +1,18 @@
+// Copyright (C) 2017 Mozilla Corporation. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: >
+ Test Atomics.sub on non-shared integer TypedArrays
+includes: [testTypedArray.js]
+---*/
+
+var ab = new ArrayBuffer(16);
+
+var int_views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
+
+testWithTypedArrayConstructors(function(View) {
+ var view = new View(ab);
+
+ assert.throws(TypeError, (() => Atomics.sub(view, 0, 0)));
+}, int_views);