aboutsummaryrefslogtreecommitdiff
path: root/deps/v8/test/mjsunit/es6/typedarray-from-detached-typedarray.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/test/mjsunit/es6/typedarray-from-detached-typedarray.js')
-rw-r--r--deps/v8/test/mjsunit/es6/typedarray-from-detached-typedarray.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/deps/v8/test/mjsunit/es6/typedarray-from-detached-typedarray.js b/deps/v8/test/mjsunit/es6/typedarray-from-detached-typedarray.js
new file mode 100644
index 0000000000..6850571bc4
--- /dev/null
+++ b/deps/v8/test/mjsunit/es6/typedarray-from-detached-typedarray.js
@@ -0,0 +1,23 @@
+// Copyright 2018 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flags: --allow-natives-syntax
+
+var typedArrayConstructors = [
+ Uint8Array,
+ Int8Array,
+ Uint16Array,
+ Int16Array,
+ Uint32Array,
+ Int32Array,
+ Uint8ClampedArray,
+ Float32Array,
+ Float64Array
+];
+
+for (constructor of typedArrayConstructors) {
+ var ta = new constructor(10);
+ %ArrayBufferDetach(ta.buffer);
+ assertThrows(() => constructor.from(ta), TypeError);
+}