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

Side by Side Diff: test/mjsunit/es6/symbols.js

Issue 1922603006: [JSON] implement indentation in the BasicJsonStringifier and expose via API. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase Created 4 years, 7 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 unified diff | Download patch
« no previous file with comments | « test/mjsunit/es6/proxies-json.js ('k') | test/mjsunit/harmony/simd.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 assertTrue(verifier(Symbol, TypeError())); 548 assertTrue(verifier(Symbol, TypeError()));
549 assertTrue(verifier(rSymbol, rError())); 549 assertTrue(verifier(rSymbol, rError()));
550 assertFalse(verifier(Symbol, rError())); 550 assertFalse(verifier(Symbol, rError()));
551 assertFalse(verifier(rSymbol, TypeError())); 551 assertFalse(verifier(rSymbol, TypeError()));
552 } 552 }
553 TestContext(); 553 TestContext();
554 554
555 555
556 function TestStringify(expected, input) { 556 function TestStringify(expected, input) {
557 assertEquals(expected, JSON.stringify(input)); 557 assertEquals(expected, JSON.stringify(input));
558 assertEquals(expected, JSON.stringify(input, null, 0)); 558 assertEquals(expected, JSON.stringify(input, (key, value) => value));
559 assertEquals(JSON.stringify(input, null, "="),
560 JSON.stringify(input, (key, value) => value, "="));
559 } 561 }
560 562
561 TestStringify(undefined, Symbol("a")); 563 TestStringify(undefined, Symbol("a"));
562 TestStringify('[{}]', [Object(Symbol())]); 564 TestStringify('[{}]', [Object(Symbol())]);
563 var symbol_wrapper = Object(Symbol("a")) 565 var symbol_wrapper = Object(Symbol("a"))
564 TestStringify('{}', symbol_wrapper); 566 TestStringify('{}', symbol_wrapper);
565 symbol_wrapper.a = 1; 567 symbol_wrapper.a = 1;
566 TestStringify('{"a":1}', symbol_wrapper); 568 TestStringify('{"a":1}', symbol_wrapper);
OLDNEW
« no previous file with comments | « test/mjsunit/es6/proxies-json.js ('k') | test/mjsunit/harmony/simd.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698