Commit 0f4a3305 authored by ager@chromium.org's avatar ager@chromium.org

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
parent ad5e73fb
......@@ -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();
}
......
......@@ -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));
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment