1
0
mirror of https://github.com/robertkrimen/otto synced 2025-10-26 20:28:49 +08:00

Add Object.toLocaleString

This commit is contained in:
Robert Krimen
2013-05-02 21:06:22 +02:00
parent fb974ca5db
commit 6c5259a651
4 changed files with 30 additions and 2 deletions

View File

@@ -44,3 +44,21 @@ func TestObject_new(t *testing.T) {
[ new Object("abc"), new Object(2+2) ];
`, "abc,4")
}
func TestObject_toLocaleString(t *testing.T) {
Terst(t)
test := runTest()
test(`
({}).toLocaleString();
`, "[object Object]")
test(`
object = {
toString: function() {
return "Nothing happens.";
}
};
object.toLocaleString();
`, "Nothing happens.")
}