missing UngetToken() when failing to parse b part of :nth-child(an+b)

RESOLVED FIXED in mozilla24

Status

()

RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: dbaron, Assigned: dbaron)

Tracking

({css3})

Trunk
mozilla24
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

While writing additional tests during the process of reviewing bug 750388, I found that we failed a set of tests that I wrote.  The patch was trivial -- a missing UngetToken() call that is needed because the incorrect token might be a parenthesis, bracket, or brace, and predates bug 750388.
Created attachment 754651 [details] [diff] [review]
Add missing UngetToken() call in an+b microsyntax parsing.
Attachment #754651 - Flags: review?(bzbarsky)
Comment on attachment 754651 [details] [diff] [review]
Add missing UngetToken() call in an+b microsyntax parsing.

Shouldn't the UngetToken happen after the REPORT_UNEXPECTED_TOKEN?

r=me with that or with a comment explaining the nonintuitive ordering in this case.
Attachment #754651 - Flags: review?(bzbarsky) → review+
From a behavior perspective it doesn't matter, since UngetToken just sets mHavePushBack and doesn't actually change mToken.  But you're right that it makes more sense that way (and most but not all of the existing occurrences of this pattern seem to be in that order).

Comment 5

6 years ago
https://hg.mozilla.org/mozilla-central/rev/2b1b8487b6b6
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
You need to log in before you can comment on or make changes to this bug.