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

Unified Diff: test/mjsunit/json2.js

Issue 11273112: Fix handling arrays with holes in JSON.stringify. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: remove stray edits Created 8 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/json-stringifier.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/json2.js
diff --git a/test/mjsunit/regress/regress-2110.js b/test/mjsunit/json2.js
similarity index 74%
copy from test/mjsunit/regress/regress-2110.js
copy to test/mjsunit/json2.js
index d7f78d26a7b4d16c4217d2b0ac136e52e4542eb1..c4392401ce74cfe501666182de515313b2771896 100644
--- a/test/mjsunit/regress/regress-2110.js
+++ b/test/mjsunit/json2.js
@@ -27,27 +27,22 @@
// Flags: --allow-natives-syntax
-var uint8 = new Uint8Array(1);
+var fast_smi = [1, 2, 3, 4];
+fast_smi.__proto__ = [7, 7, 7, 7];
+delete fast_smi[2];
+assertTrue(%HasFastSmiElements(fast_smi));
+assertEquals("[1,2,7,4]", JSON.stringify(fast_smi));
-function test() {
- uint8[0] = 0x800000aa;
- assertEquals(0xaa, uint8[0]);
-}
+var fast_double = [1.1, 2, 3, 4];
+fast_double.__proto__ = [7, 7, 7, 7];
-test();
-test();
-test();
-%OptimizeFunctionOnNextCall(test);
-test();
+delete fast_double[2];
+assertTrue(%HasFastDoubleElements(fast_double));
+assertEquals("[1.1,2,7,4]", JSON.stringify(fast_double));
-var uint32 = new Uint32Array(1);
+var fast_obj = [1, 2, {}, {}];
+fast_obj.__proto__ = [7, 7, 7, 7];
-function test2() {
- uint32[0] = 0x80123456789abcde;
- assertEquals(0x789ac000, uint32[0]);
-}
-
-test2();
-test2();
-%OptimizeFunctionOnNextCall(test2);
-test2();
+delete fast_obj[2];
+assertTrue(%HasFastObjectElements(fast_obj));
+assertEquals("[1,2,7,{}]", JSON.stringify(fast_obj));
« no previous file with comments | « src/json-stringifier.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698