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

Unified Diff: test/mjsunit/regress/regress-4665.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/regress/regress-353004.js ('k') | test/test262/test262.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/regress/regress-4665.js
diff --git a/test/mjsunit/regress/regress-4665.js b/test/mjsunit/regress/regress-4665.js
index a75d68f105633322f9c9c8151dcf4a093e7bbff2..9aed4ed0ce44e453e47a2d0cdc30c11ae7171f9b 100644
--- a/test/mjsunit/regress/regress-4665.js
+++ b/test/mjsunit/regress/regress-4665.js
@@ -11,12 +11,14 @@ FirstBuffer.__proto__ = Uint8Array
var buf = new Uint8Array(10)
buf.__proto__ = FirstBuffer.prototype
-var buf2 = buf.subarray(2)
-assertEquals(8, buf2.length);
+assertThrows(() => buf.subarray(2), TypeError);
// Second test case
+let seen_args = [];
+
function SecondBuffer (arg) {
+ seen_args.push(arg);
var arr = new Uint8Array(arg)
arr.__proto__ = SecondBuffer.prototype
return arr
@@ -25,7 +27,9 @@ SecondBuffer.prototype.__proto__ = Uint8Array.prototype
SecondBuffer.__proto__ = Uint8Array
var buf3 = new SecondBuffer(10)
+assertEquals([10], seen_args);
var buf4 = buf3.subarray(2)
-assertEquals(8, buf4.length);
+assertEquals(10, buf4.length);
+assertEquals([10, buf3.buffer], seen_args);
« no previous file with comments | « test/mjsunit/regress/regress-353004.js ('k') | test/test262/test262.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698