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

Unified Diff: test/mjsunit/harmony/array-length.js

Issue 1418093007: Revert of Check that array length stays a safe integer in Array.prototype.push (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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 | « src/messages.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/harmony/array-length.js
diff --git a/test/mjsunit/harmony/array-length.js b/test/mjsunit/harmony/array-length.js
index cc3b88105c840ffe2411013f9228b63aa33bd734..df488196ff61a055ccbc615baa5589fe3f0f03e7 100644
--- a/test/mjsunit/harmony/array-length.js
+++ b/test/mjsunit/harmony/array-length.js
@@ -33,7 +33,13 @@
assertEquals(1, o[0]);
var o = { length: Number.MAX_VALUE };
-assertThrows(() => Array.prototype.push.call(o, 1), TypeError);
+Array.prototype.push.call(o, 1);
+assertEquals(o.length, Number.MAX_SAFE_INTEGER + 1);
+assertEquals(1, o[Number.MAX_SAFE_INTEGER]);
+
+Array.prototype.push.call(o, 2);
+assertEquals(o.length, Number.MAX_SAFE_INTEGER + 1);
+assertEquals(2, o[Number.MAX_SAFE_INTEGER]);
// ArrayPop
« no previous file with comments | « src/messages.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698