Hi, while implementing function.sent support in Babel I got a doubt: is this code valid?
function* foo() {
function.sent;
}
The current specification disallows it (an ExpressionStatement can't start with function):
https://tc39.github.io/ecma262/#prod-ExpressionStatement
ExpressionStatement[Yield, Await]:
[lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }] Expression[+In, ?Yield, ?Await] ;
I couldn't find in this proposal a relaxation of that grammar, but I don't see why it should be disallowed.
Hi, while implementing
function.sentsupport in Babel I got a doubt: is this code valid?The current specification disallows it (an ExpressionStatement can't start with
function):https://tc39.github.io/ecma262/#prod-ExpressionStatement
I couldn't find in this proposal a relaxation of that grammar, but I don't see why it should be disallowed.