To continue our discussion in the old patch set...

(To maximize confusion, I'll post new comments in the context of the latest
patch set.)


https://codereview.chromium.org/663683006/diff/220001/src/preparser.h
File src/preparser.h (right):

https://codereview.chromium.org/663683006/diff/220001/src/preparser.h#newcode2506
src/preparser.h:2506: result->AsFunctionLiteral()->set_parenthesized();
On 2014/11/10 15:43:56, caitp wrote:
On 2014/11/10 15:32:02, marja wrote:
> Why?

It's basically copy/pasted from the MemberExpression -> CallExpression
path ---
so, presumably if we have an IIFE we need to do this, but I'm not sure
what
difference it makes.

I dug up a bit where this is coming from. In any case, it needs a
comment.

So, the original code is in ParseLeftHandSideExpression, and afaics,
it's meant to recognize this pattern:

function foo() { ... } (
^ result is a FunctionLiteral
                       ^  just saw the LPAREN

so in that case, that's a hint that the function will be called right
away, and set_parenthesized is called to force eager compilation. Fair
enough.

So, here, the corresponding situation would be e.g.,

function foo() { ... } `tail`
^ result is a FunctionLiteral
                            ^ just saw the TEMPLATE_TAIL

And this should be explained in the comment.

https://codereview.chromium.org/663683006/

--
--
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