| OLD | NEW |
| (Empty) |
| 1 description( | |
| 2 'Tests: Object.prototype.toLocaleString(). Related bug: <a href="https://bugs.we
bkit.org/show_bug.cgi?id=3989">3989 JSC doesn\'t implement Object.prototype.toLo
caleString()</a>' | |
| 3 ); | |
| 4 | |
| 5 var o = new Object(); | |
| 6 shouldBe("o.toLocaleString()", "o.toString()"); | |
| 7 o.toLocaleString = function () { return "Dynamic toLocaleString()"; } | |
| 8 shouldBe("o.toLocaleString()", '"Dynamic toLocaleString()"'); | |
| 9 | |
| 10 shouldBe("Object.prototype.toLocaleString.call('Hello, world!')", '"Hello, world
!"'); | |
| 11 | |
| 12 var stringPrototypeToString = String.prototype.toString; | |
| 13 String.prototype.toString = (function(){ return "stringPrototypeToString"; }); | |
| 14 shouldBe("Object.prototype.toLocaleString.call('Hello, world!')", '"stringProtot
ypeToString"'); | |
| 15 String.prototype.toString = stringPrototypeToString; | |
| OLD | NEW |