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

Unified Diff: test/mjsunit/es6/symbols.js

Issue 1495473002: [es6] correctly handle object wrappers in JSON.stringify. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase, add tests, address nit Created 5 years 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') | test/mjsunit/harmony/simd.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/es6/symbols.js
diff --git a/test/mjsunit/es6/symbols.js b/test/mjsunit/es6/symbols.js
index d071cbc01a2bd4280a5507c818451202e7a42c83..d502a836816b9d7730d73fbe6b24f306bd418d41 100644
--- a/test/mjsunit/es6/symbols.js
+++ b/test/mjsunit/es6/symbols.js
@@ -549,3 +549,16 @@ function TestContext() {
assertFalse(verifier(rSymbol, TypeError()));
}
TestContext();
+
+
+function TestStringify(expected, input) {
+ assertEquals(expected, JSON.stringify(input));
+ assertEquals(expected, JSON.stringify(input, null, 0));
+}
+
+TestStringify(undefined, Symbol("a"));
+TestStringify('[{}]', [Object(Symbol())]);
+var symbol_wrapper = Object(Symbol("a"))
+TestStringify('{}', symbol_wrapper);
+symbol_wrapper.a = 1;
+TestStringify('{"a":1}', symbol_wrapper);
« no previous file with comments | « src/json-stringifier.h ('k') | test/mjsunit/harmony/simd.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698