Attention is currently required from: Toon Verwaest.
1 comment:
Patchset:
verwaest@ PTAL
To view, visit change 3652254. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Issack John.
Patch set 7:Code-Review +1
Attention is currently required from: Issack John.
Patch set 7:Commit-Queue +2
V8 LUCI CQ submitted this change.
JSON.parse errors made user-friendly part 2
Part of the improve error messages initiative.
Based on a resource of JSON.parse() errors found at
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/JSON_bad_parse
added support for:
- 'Bad control character in string literal'
- 'Bad Unicode escape'
Previously JSON.parse('"a\bz"') would output:
SyntaxError: Unexpected token in JSON at position 2
Now the output is:
SyntaxError: Bad control character in string literal in
JSON at position 2
Previously JSON.parse("[\"\\t\\u") would output:
SyntaxError: Unexpected end of JSON input
Now the output is:
SyntaxError: Bad Unicode escape in JSON at position 6
Bug: v8:6551
Change-Id: I3ba5450c41b8a388643a15bc58e4e3fc75855d13
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3652254
Reviewed-by: Toon Verwaest <verw...@chromium.org>
Commit-Queue: Issack John <issac...@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#80642}
---
M src/common/message-template.h
M src/json/json-parser.cc
M test/mjsunit/json-errors.js
M test/mjsunit/messages.js
4 files changed, 53 insertions(+), 4 deletions(-)