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

Unified Diff: test/mjsunit/harmony/simd.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 | « test/mjsunit/es6/symbols.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/harmony/simd.js
diff --git a/test/mjsunit/harmony/simd.js b/test/mjsunit/harmony/simd.js
index 2c07eefb59a35209a2aa1cfb67e0732939f944aa..6330ac8338a403a014b5a5076dd0eff232f296d8 100644
--- a/test/mjsunit/harmony/simd.js
+++ b/test/mjsunit/harmony/simd.js
@@ -618,3 +618,17 @@ function TestSIMDObject() {
assertSame(SIMD.Bool8x16, undefined);
}
TestSIMDObject()
+
+
+function TestStringify(expected, input) {
+ assertEquals(expected, JSON.stringify(input));
+ assertEquals(expected, JSON.stringify(input, null, 0));
+}
+
+TestStringify(undefined, SIMD.Float32x4(1, 2, 3, 4));
+TestStringify('[null]', [SIMD.Float32x4(1, 2, 3, 4)]);
+TestStringify('[{}]', [Object(SIMD.Float32x4(1, 2, 3, 4))]);
+var simd_wrapper = Object(SIMD.Float32x4(1, 2, 3, 4));
+TestStringify('{}', simd_wrapper);
+simd_wrapper.a = 1;
+TestStringify('{"a":1}', simd_wrapper);
« no previous file with comments | « test/mjsunit/es6/symbols.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698