Commit 460187b5 authored by verwaest's avatar verwaest Committed by Commit bot

Revert "The expected key is a valid identifier, which is already free of \\, <0x20, "."

The optimization is invalid as indicated by the test.

BUG=
TBR=yangguo@chromium.org

Review URL: https://codereview.chromium.org/950873003

Cr-Commit-Position: refs/heads/master@{#26799}
parent 46c7d681
......@@ -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;
......
......@@ -183,3 +183,8 @@ try {
externalizeString(str, true);
} catch (e) { }
TestStringify("\"external\"", str, null, 0);
var o = {};
o.somespecialproperty = 10;
o["\x19"] = 10;
assertThrows("JSON.parse('{\"somespecialproperty\":100, \"\x19\":10}')");
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