Closed Bug 692983 Opened 13 years ago Closed 13 years ago

Make the scanner scan into a PropertyName in certain places, to ease pushing PropertyName into higher-level APIs

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla10

People

(Reporter: Waldo, Assigned: Waldo)

Details

Attachments

(1 file)

Attached patch PatchSplinter Review
I tried to use PropertyName in the interpreter in various obvious places, like JSOP_DEFVAR, JSOP_DEFFUN, and so on (where syntactic requirements mean that the atom in question must never be a number).  It turns out that works best if you push the distinction down into the scanner, then letting it percolate up from there.  This patch starts that work.  It also does a little bit (little bit) of encapsulation work on Token and JSParseNode along the way.  (I found that work necessary to be sure I was doing everything correctly here.)
Attachment #565680 - Flags: review?(cdleary)
Comment on attachment 565680 [details] [diff] [review]
Patch

Review of attachment 565680 [details] [diff] [review]:
-----------------------------------------------------------------

Moar like this.
Attachment #565680 - Flags: review?(cdleary) → review+
Comment on attachment 565680 [details] [diff] [review]
Patch

Review of attachment 565680 [details] [diff] [review]:
-----------------------------------------------------------------

::: js/src/jsscan.cpp
@@ +1069,4 @@
>                  goto error;
>          }
>          tokenbuf.shrinkBy(tokenbuf.length() - targetLength);
> +        JS_ASSERT(matchChar('>'));

...and less like this.
https://hg.mozilla.org/integration/mozilla-inbound/rev/68a211dccf2c

...with the matchChar idiocy fixed, through a consumeKnownChar method that gets the next character and asserts it to be a particular value in debug builds.
Target Milestone: --- → mozilla10
https://hg.mozilla.org/mozilla-central/rev/68a211dccf2c
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: