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

RESOLVED FIXED in mozilla10

Status

()

Core
JavaScript Engine
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: Waldo, Assigned: Waldo)

Tracking

Trunk
mozilla10
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

Created attachment 565680 [details] [diff] [review]
Patch

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

Comment 4

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