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

Unified Diff: test/mjsunit/es6/typedarray-tostring.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-sort.js ('k') | test/mjsunit/regress/regress-353004.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/es6/typedarray-tostring.js
diff --git a/test/mjsunit/es6/typedarray-tostring.js b/test/mjsunit/es6/typedarray-tostring.js
index 9d49cb1cc9a76b23c0e638f69bf71c42fa4e6e43..a1fa9c7665c46a393e6db7eabb3ac301e0b143a4 100644
--- a/test/mjsunit/es6/typedarray-tostring.js
+++ b/test/mjsunit/es6/typedarray-tostring.js
@@ -5,6 +5,8 @@
// Array's toString should call the object's own join method, if one exists and
// is callable. Otherwise, just use the original Object.toString function.
+// Flags: --allow-natives-syntax
+
var typedArrayConstructors = [
Uint8Array,
Int8Array,
@@ -96,4 +98,11 @@ for (var constructor of typedArrayConstructors) {
Number.prototype.toLocaleString = NumberToLocaleString;
})();
+
+ // Detached Operation
+ var array = new constructor([1, 2, 3]);
+ %ArrayBufferNeuter(array.buffer);
+ assertThrows(() => array.join(), TypeError);
+ assertThrows(() => array.toLocalString(), TypeError);
+ assertThrows(() => array.toString(), TypeError);
}
« no previous file with comments | « test/mjsunit/es6/typedarray-sort.js ('k') | test/mjsunit/regress/regress-353004.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698