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

Unified Diff: src/json-parser.h

Issue 950873003: Revert "The expected key is a valid identifier, which is already free of \\, <0x20, "." (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 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 | « no previous file | test/mjsunit/json2.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/json-parser.h
diff --git a/src/json-parser.h b/src/json-parser.h
index 9a22738e98d9ae806366d94da030a345b10fed63..4d451389174be9047fafce183fcaa18b0f687b98 100644
--- a/src/json-parser.h
+++ b/src/json-parser.h
@@ -108,8 +108,9 @@ class JsonParser BASE_EMBEDDED {
const uint8_t* expected_chars = content.ToOneByteVector().start();
for (int i = 0; i < length; i++) {
uint8_t c0 = input_chars[i];
- // The expected string has to be free of \, " and characters < 0x20.
- if (c0 != expected_chars[i]) return false;
+ if (c0 != expected_chars[i] || c0 == '"' || c0 < 0x20 || c0 == '\\') {
+ return false;
+ }
}
if (input_chars[length] == '"') {
position_ = position_ + length + 1;
« no previous file with comments | « no previous file | test/mjsunit/json2.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698