Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(37)

Unified Diff: test/mjsunit/es6/typedarray-iteration.js

Issue 2778623003: [typedarrays] Check detached buffer at start of typed array methods (Closed)
Patch Set: pass test262 for subarray Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/mjsunit/es6/typedarray-indexing.js ('k') | test/mjsunit/es6/typedarray-reduce.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
})();
}
« no previous file with comments | « test/mjsunit/es6/typedarray-indexing.js ('k') | test/mjsunit/es6/typedarray-reduce.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698