Closed Bug 701973 Opened 13 years ago Closed 13 years ago

Eliminate token munging

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla11

People

(Reporter: Waldo, Assigned: Waldo)

Details

Attachments

(2 files)

These patches will be atop the ones in bug 701620.
Attachment #573985 - 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+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: