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 an error to a string if the conversion detects invalid UTF-8 encoding and throws an error (it currently does not, but should).
js_parse_expect
.The previous code was bogus:
this was causing a bug on
eval("do;")
wheretok
isTOK_WHILE
(-70, 0xBA) creating an invalid UTF-8 encoding (lone trailing byte). This would ultimately have caused a failure inJS_ThrowError2
ifJS_NewString
failed when converting an error to a string if the conversion detects invalid UTF-8 encoding and throws an error (it currently does not, but should).JS_NewString
failure inJS_ThrowError2
JS_FreeCString
failure in run-test262.c