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)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla36

People

(Reporter: arai, Assigned: arai)

References

Details

Attachments

(1 file)

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.
Depends on: 1066827
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)
Attachment #8514114 - Flags: review?(jwalden+bmo) → review+
Thank you!
Keywords: checkin-needed
(In reply to Tooru Fujisawa [:arai] from comment #2) > Thank you! https://twitter.com/sayrer/status/19304989209
(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 :)
(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
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.

Attachment

General

Created:
Updated:
Size: