blob: c049a25ddd09f72a684907347383612e18cdfd31 [file] [log] [blame]
Emily Bernierd0a1eb72015-03-24 16:35:39 -04001// 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 Bernierd0a1eb72015-03-24 16:35:39 -04005function 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 Murdoch61f157c2016-09-16 13:49:30 +010012 delete JSON[Symbol.toStringTag];
13 assertEquals('[object Object]', "" + JSON);
Emily Bernierd0a1eb72015-03-24 16:35:39 -040014}
15testJSONToString();