The default bug view has changed. See this FAQ.

Eliminate token munging

RESOLVED FIXED in mozilla11

Status

()

Core
JavaScript Engine
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: Waldo, Assigned: Waldo)

Tracking

Trunk
mozilla11
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

Created attachment 573985 [details] [diff] [review]
Extract TOK_CONST from TOK_VAR, and make Parser::variables not implicitly depend on the current token

These patches will be atop the ones in bug 701620.
Attachment #573985 - Flags: review?(jorendorff)
Created attachment 573986 [details] [diff] [review]
Make Parser::functionBody callers specify the body kind, rather than inferring it from the current token
Attachment #573986 - Flags: review?(jorendorff)
Comment on attachment 573985 [details] [diff] [review]
Extract TOK_CONST from TOK_VAR, and make Parser::variables not implicitly depend on the current token

This patch is a beautiful thing. Thanks!

>+        DebugOnly<bool> matched = matchToken(tt);
>+        JS_ASSERT(matched);

This could be
  JS_ALWAYS_TRUE(matchToken(tt));

Your call.
Attachment #573985 - Flags: review?(jorendorff) → review+
Comment on attachment 573986 [details] [diff] [review]
Make Parser::functionBody callers specify the body kind, rather than inferring it from the current token

Again, nothing but beautiful.

>     /* Mutators. */
>     bool reportCompileErrorNumberVA(ParseNode *pn, uintN flags, uintN errorNumber, va_list ap);
>-    void mungeCurrentToken(TokenKind newKind) { tokens[cursor].type = newKind; }

That comment doesn't make sense anymore, not to say it really made sense before.
Attachment #573986 - Flags: review?(jorendorff) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/ef50be56af03
https://hg.mozilla.org/integration/mozilla-inbound/rev/977ecc68c1f8
Target Milestone: --- → mozilla11
https://hg.mozilla.org/mozilla-central/rev/ef50be56af03
https://hg.mozilla.org/mozilla-central/rev/977ecc68c1f8
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.