OLD | NEW |
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 Loading... |
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); |
OLD | NEW |