Fix JSON.parse typo which causes the input not to be string converted.

Review URL: http://codereview.chromium.org/2981004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5051 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
ager@chromium.org 2010-07-13 10:57:45 +00:00
parent ad5e73fb85
commit 0f4a330508
2 changed files with 6 additions and 2 deletions

View File

@ -29,7 +29,7 @@ var $JSON = global.JSON;
function ParseJSONUnfiltered(text) {
var s = $String(text);
var f = %CompileString(text, true);
var f = %CompileString(s, true);
return f();
}

View File

@ -85,7 +85,7 @@ n4.toISOString = function () {
};
assertEquals(null, n4.toJSON());
assertEquals(Object.prototype, JSON.__proto__);
assertTrue(Object.prototype === JSON.__proto__);
assertEquals("[object JSON]", Object.prototype.toString.call(JSON));
// DontEnum
@ -313,3 +313,7 @@ TestInvalid('1); throw "foo"; (1');
var x = 0;
eval("(1); x++; (1)");
TestInvalid('1); x++; (1');
// Test string conversion of argument.
var o = { toString: function() { return "42"; } };
assertEquals(42, JSON.parse(o));