Index: test/mjsunit/es6/typedarray-findindex.js |
diff --git a/test/mjsunit/es6/typedarray-findindex.js b/test/mjsunit/es6/typedarray-findindex.js |
index 51c439203d907bad0bef433858d49449c6764905..7447395e771741cd51219291970dc7e6e665fc40 100644 |
--- a/test/mjsunit/es6/typedarray-findindex.js |
+++ b/test/mjsunit/es6/typedarray-findindex.js |
@@ -2,6 +2,8 @@ |
// 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, |
@@ -184,4 +186,15 @@ assertEquals(Array.prototype.findIndex.call(a, |
function(elt) { x += elt; return false; }), -1); |
assertEquals(x, 4); |
+// Detached Operation |
+ var tmp = { |
+ [Symbol.toPrimitive]() { |
+ assertUnreachable("Parameter should not be processed when " + |
+ "array.[[ViewedArrayBuffer]] is neutered."); |
+ return 0; |
+ } |
+ }; |
+ var array = new constructor([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); |
+ %ArrayBufferNeuter(array.buffer); |
+ assertThrows(() => array.findIndex(tmp), TypeError); |
} |