You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yes, it seems reasonable that an expression statement could start with function . sent. For example, that would be useful for making recursive function calls. So, you should consider that to be part of the proposal.
But, actually specify that via the current ES grammar notation looks like it may be tricky and might even require extending the notation. FunctionDeclaration probably will need a [lookahead ∉ { function . }] guard, but that's not enough. We also need to find a way for ExpressionStatement to express a conditional multi-token lookahead that will allow function .. Maybe something like:
Activity
allenwb commentedon Jul 7, 2017
Good catch.
Yes, it seems reasonable that an expression statement could start with
function . sent. For example, that would be useful for making recursive function calls. So, you should consider that to be part of the proposal.But, actually specify that via the current ES grammar notation looks like it may be tricky and might even require extending the notation. FunctionDeclaration probably will need a
[lookahead ∉ { function . }]guard, but that's not enough. We also need to find a way for ExpressionStatement to express a conditional multi-token lookahead that will allowfunction .. Maybe something like:nicolo-ribaudo commentedon Jul 7, 2017
What about using positive lookahead?
allenwb commentedon Jul 7, 2017
yes, adding positive lookahead to the notation is probably the better way to go