The current implementation of the JSON parser fails when parsing valid JSON that contains trailing whitespace after the closing bracket or brace. This behavior is inconsistent with the JSON.parse, which allows for insignificant whitespace outside of the outermost brackets.
Description
The current implementation of the JSON parser fails when parsing valid JSON that contains trailing whitespace after the closing bracket or brace. This behavior is inconsistent with the
JSON.parse
, which allows for insignificant whitespace outside of the outermost brackets.Steps to reproduce
Attempt to parse JSON string
Current behaviour
The parser throws
Error: Parser is already finished
Expected Behavior
The parser should successfully parse the JSON string, ignoring the trailing whitespace.