-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve parsing error messages (#405)
- output more informative error messages in `js_parse_expect`. The previous code was bogus: ``` return js_parse_error(s, "expecting '%c'", tok); ``` this was causing a bug on `eval("do;")` where `tok` is `TOK_WHILE` (-70, 0xBA) creating an invalid UTF-8 encoding (lone trailing byte). This would ultimately have caused a failure in `JS_ThrowError2` if `JS_NewString` failed when converting the error message to a string if the conversion detected the invalid UTF-8 encoding and throwed an error (it currently does not, but should). - test for `JS_NewString` failure in `JS_ThrowError2` - test for `JS_FreeCString` failure in run-test262.c - add more test cases
- Loading branch information
Showing
3 changed files
with
72 additions
and
14 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
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