https://codereview.chromium.org/880253004/diff/1/src/parser.cc
File src/parser.cc (right):
https://codereview.chromium.org/880253004/diff/1/src/parser.cc#newcode1078
src/parser.cc:1078: result = expression->AsFunctionLiteral();
On 2015/01/29 09:53:01, marja wrote:
Why are setting parsing_lazy_arrow_parameters_ to true and false so
far apart
(conceptually)? Can we set it to false right after ParseExpression
here? (Then
it would be trivial to see that it is actually set back to false after
we're
done.)
That does not work.
ParseExpression() here parses the whole arrow function, including the
body, which can itself en up calling ParseExpression().
The flag has to be active only for the “expressions” inside the
parameter list of the arrow function, that's why the flag is set to
“false” in DeclareArrowParametersFromExpression(): at that point it's
certain that at least one entire arrow function parameter list has been
parsed.
Other arrow functions contained inside the top-level arrow function
being parsed lazily are always parsed eagerly, so for those the flag
will be always “false” because their parsing has not been started by
ParseLazy().
I hope it is clearer now why the flag is reset inside
DeclareArrowParametersFromExpression().
https://codereview.chromium.org/880253004/
--
--
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.