Still non-owner LGTM with a nit and a question

On 2015/03/19 12:42:30, aperez wrote:
I have checked eager parsing with a similar test case using
“eval('v => v + 1')” in place of the arrow function. It works
fine in the current Git HEAD, without needing the fix.

Can you confirm that you ran this test with lazy parsing disabled? Thanks :)


https://codereview.chromium.org/1023483003/diff/1/src/parser.cc
File src/parser.cc (right):

https://codereview.chromium.org/1023483003/diff/1/src/parser.cc#newcode1149
src/parser.cc:1149: // Scanning must end at the same position that was
recorded
On 2015/03/19 11:00:26, marja wrote:
And why do we have ok == true in case of the stack overflow? Isn't
that weird?

I thought so too but to expand on what Adri found:

  - You go to parse an Assignment expression
  - You get the VariableProxy
  - You start to look ahead to see if the next token indicates a
compound expression, like = or + or something
  - The peeked token Token::ILLEGAL doesn't match any of the tokens that
can indicate a compoint expression
  - You return the VariableProxy instead, a valid expression, OK=true.

If this were a function(){} then we'd get an error expecting to consume
the right-bracket.  Since it's an arrow function, depending on where we
are in parsing it can succeed or not, as described in the CL message.

Agreed that it is very weird though!

https://codereview.chromium.org/1023483003/diff/20001/src/parser.cc
File src/parser.cc (right):

https://codereview.chromium.org/1023483003/diff/20001/src/parser.cc#newcode1154
src/parser.cc:1154: // The input is known to be a function that is being
lazy-parsed.
lazy-parsed is not great terminology IMO.  How about

// The pre-parser saw an arrow function here, so the full parser must
produce a FunctionLiteral.

https://codereview.chromium.org/1023483003/

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to