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

Unified Diff: test/mjsunit/json2.js

Issue 11363078: Add fast path for FastProperty objects in JSON.stringify. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: addressed comment. Created 8 years, 1 month 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/harmony/proxies-json.js ('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/json2.js b/test/mjsunit/json2.js
index 82ff572e009eb6567e68b1dff10c2e77a74e7c2b..4c0b8f58c8ef6a9cc0ee7aba360f0a48fc0e04fe 100644
--- a/test/mjsunit/json2.js
+++ b/test/mjsunit/json2.js
@@ -133,3 +133,21 @@ fast_obj.__proto__ = [7, 7, 7, 7];
delete fast_obj[2];
assertTrue(%HasFastObjectElements(fast_obj));
assertEquals("[1,2,7,{}]", JSON.stringify(fast_obj));
+
+var getter_side_effect = { a: 1,
+ get b() {
+ delete this.a;
+ delete this.c;
+ this.e = 5;
+ return 2;
+ },
+ c: 3,
+ d: 4 };
+assertEquals('{"a":1,"b":2,"d":4}', JSON.stringify(getter_side_effect));
+assertEquals('{"b":2,"d":4,"e":5}', JSON.stringify(getter_side_effect));
+
+var non_enum = {};
+non_enum.a = 1;
+Object.defineProperty(non_enum, "b", { value: 2, enumerable: false });
+non_enum.c = 3;
+assertEquals('{"a":1,"c":3}', JSON.stringify(non_enum));
« no previous file with comments | « test/mjsunit/harmony/proxies-json.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698