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

Unified Diff: test/mjsunit/regress/regress-369450.js

Issue 264973008: Checks for empty array case added before casting elements to FixedDoubleArray. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 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/runtime.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/regress/regress-369450.js
diff --git a/test/mjsunit/regress/regress-empty-fixed-double-array.js b/test/mjsunit/regress/regress-369450.js
similarity index 55%
copy from test/mjsunit/regress/regress-empty-fixed-double-array.js
copy to test/mjsunit/regress/regress-369450.js
index 1db9e2b3e54e2abfddddd23f4ee6618ae438db20..e4523619f08407a532787976a7c36fd39a34c98f 100644
--- a/test/mjsunit/regress/regress-empty-fixed-double-array.js
+++ b/test/mjsunit/regress/regress-369450.js
@@ -4,12 +4,12 @@
// Flags: --allow-natives-syntax --enable-slow-asserts
-function f(a, x) {
- a.shift();
- a[0] = x;
-}
-
-f([1], 1.1);
-f([1], 1.1);
-%OptimizeFunctionOnNextCall(f);
-f([1], 1.1);
+var v = [1.3];
+v.length = 0;
+
+var json = JSON.stringify(v);
+assertEquals("[]", json);
+
+Array.prototype[0] = 5.5;
+var arr = [].concat(v, [{}], [2.3]);
+assertEquals([{}, 2.3], arr);
« no previous file with comments | « src/runtime.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698