Closed
Bug 883207
Opened 12 years ago
Closed 12 years ago
Add Parser::pos()
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla24
People
(Reporter: jorendorff, Assigned: jorendorff)
Details
Attachments
(1 file, 1 obsolete file)
|
27.82 KB,
patch
|
Waldo
:
review+
|
Details | Diff | Splinter Review |
Precognitive followup to bug 872735 comment 11.
tokenStream.currentToken().pos is such a common idiom in the Parser that a convenience function is kind of nice.
(I found one use of the idiom that is actually totally unnecessary, in the amazingly twisty Parser::forStatement(). We have an assignment to forHead->pn_pos, and then a few lines later both fields are overwritten. D'oh.)
| Assignee | ||
Comment 1•12 years ago
|
||
Attachment #762741 -
Flags: review?(jwalden+bmo)
| Assignee | ||
Updated•12 years ago
|
Assignee: general → jorendorff
| Assignee | ||
Comment 2•12 years ago
|
||
Just like v1, but eliminate unnecessary 'uint32_t end = pos().end;' in a few places where the temporary 'end' isn't needed anymore to avoid splitting lines.
Attachment #762741 -
Attachment is obsolete: true
Attachment #762741 -
Flags: review?(jwalden+bmo)
| Assignee | ||
Updated•12 years ago
|
Attachment #762780 -
Flags: review?(jwalden+bmo)
Comment 3•12 years ago
|
||
Comment on attachment 762780 [details] [diff] [review]
v2
Review of attachment 762780 [details] [diff] [review]:
-----------------------------------------------------------------
::: js/src/frontend/Parser.cpp
@@ +4702,4 @@
> RootedPropertyName label(context);
> if (!MatchLabel(context, &tokenStream, &label))
> return null();
> + pn = handler.newContinue(label, begin, pos().end);
I'd kind of prefer methods take TokenPos arguments (or const&) rather than begin/end separately -- and there are some methods in here which do this already -- but that's not an immediate concern to fix here.
Attachment #762780 -
Flags: review?(jwalden+bmo) → review+
| Assignee | ||
Comment 4•12 years ago
|
||
OK, I agree. We'll fix it in bug 883333.
Comment 5•12 years ago
|
||
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
You need to log in
before you can comment on or make changes to this bug.
Description
•