Closed
Bug 1089038
Opened 11 years ago
Closed 11 years ago
Do not call peekToken after matchToken failed in frontend/Parser.cpp
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla36
People
(Reporter: arai, Assigned: arai)
References
Details
Attachments
(1 file)
|
2.17 KB,
patch
|
Waldo
:
review+
|
Details | Diff | Splinter Review |
Derived from bug 1066827 comment #43
http://dxr.mozilla.org/mozilla-central/source/js/src/frontend/Parser.cpp#700
> if (!tokenStream.matchToken(TOK_EOF)) {
> report(ParseError, false, null(), JSMSG_GARBAGE_AFTER_INPUT,
> "script", TokenKindToDesc(tokenStream.peekToken()));
> return null();
> }
http://dxr.mozilla.org/mozilla-central/source/js/src/frontend/Parser.cpp#819
> if (!tokenStream.matchToken(TOK_EOF)) {
> report(ParseError, false, null(), JSMSG_GARBAGE_AFTER_INPUT,
> "function body", TokenKindToDesc(tokenStream.peekToken()));
> return null();
> }
They should be getToken.
NOTE: those code will be changed soon by bug 1066827, so the patch should be written after it was fixed.
| Assignee | ||
Comment 1•11 years ago
|
||
Replaced matchToken + peekToken with getToken.
I guess ungetToken is not required there.
Green on try run: https://treeherder.mozilla.org/ui/#/jobs?repo=try&revision=ca52cfbf435c
Attachment #8514114 -
Flags: review?(jwalden+bmo)
Updated•11 years ago
|
Attachment #8514114 -
Flags: review?(jwalden+bmo) → review+
Comment 3•11 years ago
|
||
(In reply to Tooru Fujisawa [:arai] from comment #2)
> Thank you!
https://twitter.com/sayrer/status/19304989209
Comment 4•11 years ago
|
||
Assignee: nobody → arai_a
Keywords: checkin-needed
Comment 5•11 years ago
|
||
(In reply to Jeff Walden [:Waldo] (remove +bmo to email) from comment #3)
> (In reply to Tooru Fujisawa [:arai] from comment #2)
> > Thank you!
>
> https://twitter.com/sayrer/status/19304989209
Lol, thanks Waldo, nearly forgot about that one :)
Comment 6•11 years ago
|
||
(In reply to Carsten Book [:Tomcat] from comment #5)
> Lol, thanks Waldo, nearly forgot about that one :)
Rest assured that I have not. :-D
$ ack --no-filename --count 19304989209 ~/.chatzilla/*.default/chatzilla/logs/
24
Comment 7•11 years ago
|
||
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
You need to log in
before you can comment on or make changes to this bug.
Description
•