Commit a7f3edb8 authored by yangguo@chromium.org's avatar yangguo@chromium.org

Make sure the fast case of ScanJsonString bails out to the slow case correctly.

R=verwaest@chromium.org
BUG=

Review URL: https://chromiumcodereview.appspot.com/11185050

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12757 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 23df9b9d
......@@ -580,9 +580,12 @@ Handle<String> JsonParser<seq_ascii>::ScanJsonString() {
uc32 c0 = c0_;
do {
if (c0 == '\\') {
c0_ = c0;
int beg_pos = position_;
position_ = position;
return SlowScanJsonString<SeqAsciiString, char>(source_,
position_,
position);
beg_pos,
position_);
}
if (c0 < 0x20) return Handle<String>::null();
running_hash = StringHasher::AddCharacterCore(running_hash, c0);
......
......@@ -428,5 +428,5 @@ var o = JSON.parse('{"__proto__":5}');
assertEquals(Object.prototype, o.__proto__); // __proto__ isn't changed.
assertEquals(0, Object.keys(o).length); // __proto__ isn't added as enumerable.
var json = '{"stuff before slash\\\\stuff after slash":"whatever"}';
assertEquals(json, JSON.stringify(JSON.parse(json)));
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