mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1089038 - Do not call peekToken after matchToken failed. r=Waldo
This commit is contained in:
parent
81e1888082
commit
4f62dbcfd7
@ -709,13 +709,10 @@ Parser<ParseHandler>::parse(JSObject *chain)
|
|||||||
|
|
||||||
Node pn = statements();
|
Node pn = statements();
|
||||||
if (pn) {
|
if (pn) {
|
||||||
bool matched;
|
TokenKind tt;
|
||||||
if (!tokenStream.matchToken(&matched, TOK_EOF))
|
if (!tokenStream.getToken(&tt))
|
||||||
return null();
|
return null();
|
||||||
if (!matched) {
|
if (tt != TOK_EOF) {
|
||||||
TokenKind tt;
|
|
||||||
if (!tokenStream.peekToken(&tt))
|
|
||||||
return null();
|
|
||||||
report(ParseError, false, null(), JSMSG_GARBAGE_AFTER_INPUT,
|
report(ParseError, false, null(), JSMSG_GARBAGE_AFTER_INPUT,
|
||||||
"script", TokenKindToDesc(tt));
|
"script", TokenKindToDesc(tt));
|
||||||
return null();
|
return null();
|
||||||
@ -834,13 +831,10 @@ Parser<FullParseHandler>::standaloneFunctionBody(HandleFunction fun, const AutoN
|
|||||||
if (!pn)
|
if (!pn)
|
||||||
return null();
|
return null();
|
||||||
|
|
||||||
bool matched;
|
TokenKind tt;
|
||||||
if (!tokenStream.matchToken(&matched, TOK_EOF))
|
if (!tokenStream.getToken(&tt))
|
||||||
return null();
|
return null();
|
||||||
if (!matched) {
|
if (tt != TOK_EOF) {
|
||||||
TokenKind tt;
|
|
||||||
if (!tokenStream.peekToken(&tt))
|
|
||||||
return null();
|
|
||||||
report(ParseError, false, null(), JSMSG_GARBAGE_AFTER_INPUT,
|
report(ParseError, false, null(), JSMSG_GARBAGE_AFTER_INPUT,
|
||||||
"function body", TokenKindToDesc(tt));
|
"function body", TokenKindToDesc(tt));
|
||||||
return null();
|
return null();
|
||||||
|
Loading…
Reference in New Issue
Block a user