forked from mozilla/rhino
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- trailing commas aren't allowed in object/array literals per JSON spec - avoid using Integer.parseInt() to parse unicode escape sequences since parseInt() also accepts non-ASCII digits - also avoid using Character.isDigit() in readNumber() for the very same reason - readString() always created a StringBuilder instance to collect the input data, obviously this is actually only necessary when the input contains escaped characters. Therefore I've changed readString() to take the same approach as used in jsonparser.cpp - the JSON number specification is stricter than Double.parseDouble(), for example Double.parseDouble() accepts the input string '10.'. To ensure only valid JSON number literals are passed to Double.parseDouble(), readNumber() was refactored to perform the necessary input validation.
- Loading branch information
Showing
2 changed files
with
217 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters