Closed leobalter closed 4 years ago
new new class {}()?.constructor?.();
is equivalent to new FOO?.constructor?.()
, which should be a syntax error. Indeed, we don’t support “optional new”, my main reason being that the expected complication of the grammar largely outweighs the (lack of) use cases. See #22.
Closing per housekeeping.
new new class {}()?.constructor?.();
(equivalent tonew new class {}().constructor();
)When reading the proposed syntax grammar, this seems correct, but it's one of the few errors I found when parsing with Babel.
Is that an error from Babel or the actual code?