Last Comment Bug 692983 - Make the scanner scan into a PropertyName in certain places, to ease pushing PropertyName into higher-level APIs
: Make the scanner scan into a PropertyName in certain places, to ease pushing ...
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla10
Assigned To: Jeff Walden [:Waldo] (remove +bmo to email)
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-10-07 16:03 PDT by Jeff Walden [:Waldo] (remove +bmo to email)
Modified: 2011-10-15 05:21 PDT (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch (27.70 KB, patch)
2011-10-07 16:03 PDT, Jeff Walden [:Waldo] (remove +bmo to email)
cdleary: review+
Details | Diff | Review

Description Jeff Walden [:Waldo] (remove +bmo to email) 2011-10-07 16:03:15 PDT
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.)
Comment 1 Chris Leary [:cdleary] (not checking bugmail) 2011-10-07 16:45:06 PDT
Comment on attachment 565680 [details] [diff] [review]
Patch

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

Moar like this.
Comment 2 Jeff Walden [:Waldo] (remove +bmo to email) 2011-10-14 11:36:31 PDT
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.
Comment 3 Jeff Walden [:Waldo] (remove +bmo to email) 2011-10-14 11:37:28 PDT
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.
Comment 4 Ed Morley [:emorley] 2011-10-15 05:21:27 PDT
https://hg.mozilla.org/mozilla-central/rev/68a211dccf2c

Note You need to log in before you can comment on or make changes to this bug.