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

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

Issue 2778623003: [typedarrays] Check detached buffer at start of typed array methods (Closed)
Patch Set: rebase 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
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..b3a2c68428ca02ce26a4dae8dc7760bba3622c7d 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,10 @@ 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);
Camillo Bruni 2017/04/03 08:18:14 Please add the toString case as well (or a TODO if
Choongwoo Han 2017/04/03 08:42:29 Done.
}

Powered by Google App Engine
This is Rietveld 408576698