Index: test/mjsunit/es6/typedarray-iteration.js |
diff --git a/test/mjsunit/es6/typedarray-iteration.js b/test/mjsunit/es6/typedarray-iteration.js |
index 9560cbc5dff4efebe81979b7c1e0b39a58feffc0..b423ed0f045fe873028371659d787b8053a1bfdc 100644 |
--- a/test/mjsunit/es6/typedarray-iteration.js |
+++ b/test/mjsunit/es6/typedarray-iteration.js |
@@ -4,6 +4,8 @@ |
// Tests for standard TypedArray array iteration functions. |
+// Flags: --allow-natives-syntax |
+ |
var typedArrayConstructors = [ |
Uint8Array, |
Int8Array, |
@@ -77,6 +79,11 @@ for (var constructor of typedArrayConstructors) { |
assertArrayLikeEquals([2], a.filter(function(elt) { |
return elt == 2; |
}), constructor); |
+ |
+ // Detached Operation |
+ var array = new constructor([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); |
+ %ArrayBufferNeuter(array.buffer); |
+ assertThrows(() => array.filter(() => false), TypeError); |
})(); |
(function TypedArrayMapTest() { |
@@ -130,6 +137,11 @@ for (var constructor of typedArrayConstructors) { |
return NaN; |
}), constructor); |
} |
+ |
+ // Detached Operation |
+ var array = new constructor([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); |
+ %ArrayBufferNeuter(array.buffer); |
+ assertThrows(() => array.map((v) => v), TypeError); |
})(); |
// |
@@ -189,6 +201,11 @@ for (var constructor of typedArrayConstructors) { |
assertEquals(false, Array.prototype.some.call(a, function(elt) { |
return elt == 2; |
})); |
+ |
+ // Detached Operation |
+ var array = new constructor([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); |
+ %ArrayBufferNeuter(array.buffer); |
+ assertThrows(() => array.some((v) => false), TypeError); |
})(); |
} |