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}
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;
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}')");