mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-26 14:46:02 +00:00
Fixed error message associated with trying to use a keyword as an
identifier; it was only printing the first character of the identifier, because it expected 8-bit chars, and was being called with a 16-bit representation of the offending keyword.
This commit is contained in:
parent
a10d8fc983
commit
1fa5a6ab37
@ -2333,9 +2333,10 @@ PrimaryExpr(JSContext *cx, JSTokenStream *ts, JSTreeContext *tc)
|
||||
case TOK_IMPORT:
|
||||
#endif
|
||||
case TOK_RESERVED:
|
||||
js_ReportCompileError(cx, ts, "%.*s is a reserved identifier",
|
||||
ts->token.pos.end.index - ts->token.pos.begin.index,
|
||||
ts->token.ptr);
|
||||
js_ReportCompileError(cx, ts, "%s is a reserved identifier",
|
||||
js_DeflateString(cx, ts->token.ptr,
|
||||
ts->token.pos.end.index -
|
||||
ts->token.pos.begin.index));
|
||||
return NULL;
|
||||
|
||||
case TOK_ERROR:
|
||||
|
@ -2337,9 +2337,10 @@ PrimaryExpr(JSContext *cx, JSTokenStream *ts, JSTreeContext *tc)
|
||||
case TOK_IMPORT:
|
||||
#endif
|
||||
case TOK_RESERVED:
|
||||
js_ReportCompileError(cx, ts, "%.*s is a reserved identifier",
|
||||
ts->token.pos.end.index - ts->token.pos.begin.index,
|
||||
ts->token.ptr);
|
||||
js_ReportCompileError(cx, ts, "%s is a reserved identifier",
|
||||
js_DeflateString(cx, ts->token.ptr,
|
||||
ts->token.pos.end.index -
|
||||
ts->token.pos.begin.index));
|
||||
return NULL;
|
||||
|
||||
case TOK_ERROR:
|
||||
|
Loading…
x
Reference in New Issue
Block a user