OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 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 |
| 5 function testMutatedPrimitiveToStringTag(primitive) { |
| 6 Object.defineProperty( |
| 7 primitive.__proto__, Symbol.toStringTag, |
| 8 {value: "bogus", configurable: true, writable: false, enumerable: false}); |
| 9 assertEquals("[object bogus]", Object.prototype.toString.call(primitive)); |
| 10 } |
| 11 |
| 12 testMutatedPrimitiveToStringTag(''); |
| 13 testMutatedPrimitiveToStringTag(true); |
| 14 testMutatedPrimitiveToStringTag(42); |
| 15 testMutatedPrimitiveToStringTag(42.42); |
| 16 testMutatedPrimitiveToStringTag(Symbol()); |
OLD | NEW |