blob: 45d75a3a1fa2d16e8cb8eb3d4bee57fa38a2f038 [file] [log] [blame]
var stringObject = new String("Foo");
shouldBeEqualToString('nativeJSON.stringify(stringObject)', '"Foo"');
shouldBe('nativeJSON.stringify(stringObject)', 'JSON.stringify(stringObject)');
stringObject.toJSON = function() { return "Weird Case 1"; }
shouldBeEqualToString('nativeJSON.stringify(stringObject)', '"Weird Case 1"');
shouldBe('nativeJSON.stringify(stringObject)', 'JSON.stringify(stringObject)');
var stringObject = new String("Bar");
shouldBeEqualToString('nativeJSON.stringify(stringObject)', '"Bar"');
shouldBe('nativeJSON.stringify(stringObject)', 'JSON.stringify(stringObject)');
String.prototype.toJSON = function() { return "Weird Case 2"; }
shouldBeEqualToString('nativeJSON.stringify(stringObject)', '"Weird Case 2"');
shouldBe('nativeJSON.stringify(stringObject)', 'JSON.stringify(stringObject)');