Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(683)

Unified Diff: src/json-parser.cc

Issue 7020028: Untank compilation and fix JSON parse bug introduced in r8147. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/json-parser.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/json-parser.cc
===================================================================
--- src/json-parser.cc (revision 8147)
+++ src/json-parser.cc (working copy)
@@ -167,6 +167,7 @@
AdvanceSkipWhitespace();
if (c0_ != '}') {
do {
+ if (c0_ != '"') return ReportUnexpectedCharacter();
Handle<String> key = ParseJsonSymbol();
if (key.is_null() || c0_ != ':') return ReportUnexpectedCharacter();
AdvanceSkipWhitespace();
@@ -283,7 +284,7 @@
return isolate()->factory()->NewNumber(number_);
}
-Handle<Object> JsonParser::SlowScanJsonString() {
+Handle<String> JsonParser::SlowScanJsonString() {
// The currently scanned ascii characters.
Handle<String> ascii(isolate()->factory()->NewSubString(source_,
beg_pos_,
@@ -312,7 +313,7 @@
}
// Check for control character (0x00-0x1f) or unterminated string (<0).
- if (c0_ < 0x20) return ReportUnexpectedCharacter();
+ if (c0_ < 0x20) return Handle<String>::null();
if (c0_ != '\\') {
seq_two_byte->SeqTwoByteStringSet(count++, c0_);
Advance();
@@ -345,7 +346,7 @@
Advance();
int digit = HexValue(c0_);
if (digit < 0) {
- return ReportUnexpectedCharacter();
+ return Handle<String>::null();
}
value = value * 16 + digit;
}
@@ -353,7 +354,7 @@
break;
}
default:
- return ReportUnexpectedCharacter();
+ return Handle<String>::null();
}
Advance();
}
@@ -381,14 +382,14 @@
template <bool is_symbol>
-Handle<Object> JsonParser::ScanJsonString() {
+Handle<String> JsonParser::ScanJsonString() {
ASSERT_EQ('"', c0_);
Advance();
beg_pos_ = position_;
// Fast case for ascii only without escape characters.
while (c0_ != '"') {
// Check for control character (0x00-0x1f) or unterminated string (<0).
- if (c0_ < 0x20) return ReportUnexpectedCharacter();
+ if (c0_ < 0x20) return Handle<String>::null();
if (c0_ != '\\' && c0_ < kMaxAsciiCharCode) {
Advance();
} else {
« no previous file with comments | « src/json-parser.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698