v8/src/json
Issack John a679edbb6e 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 <verwaest@chromium.org>
Commit-Queue: Issack John <issackjohn@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#80642}
2022-05-19 15:07:03 +00:00
..
DIR_METADATA Add DIR_METADATA files to v8. 2020-10-20 22:12:28 +00:00
json-parser.cc JSON.parse errors made user-friendly part 2 2022-05-19 15:07:03 +00:00
json-parser.h JSON.parse errors made user-friendly 2022-05-16 17:02:37 +00:00
json-stringifier.cc Replace STATIC_ASSERT with static_assert 2022-05-13 13:46:27 +00:00
json-stringifier.h Move more relevant files to src/objects 2019-05-23 08:52:30 +00:00
OWNERS Add DIR_METADATA files to v8. 2020-10-20 22:12:28 +00:00