Emily Bernier | d0a1eb7 | 2015-03-24 16:35:39 -0400 | [diff] [blame] | 1 | // Copyright 2014 the V8 project authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
Emily Bernier | d0a1eb7 | 2015-03-24 16:35:39 -0400 | [diff] [blame] | 5 | function testJSONToString() { |
| 6 | assertEquals('[object JSON]', "" + JSON); |
| 7 | assertEquals("JSON", JSON[Symbol.toStringTag]); |
| 8 | var desc = Object.getOwnPropertyDescriptor(JSON, Symbol.toStringTag); |
| 9 | assertTrue(desc.configurable); |
| 10 | assertFalse(desc.writable); |
| 11 | assertEquals("JSON", desc.value); |
Ben Murdoch | 61f157c | 2016-09-16 13:49:30 +0100 | [diff] [blame] | 12 | delete JSON[Symbol.toStringTag]; |
| 13 | assertEquals('[object Object]', "" + JSON); |
Emily Bernier | d0a1eb7 | 2015-03-24 16:35:39 -0400 | [diff] [blame] | 14 | } |
| 15 | testJSONToString(); |