For following input:
Playground Link
const foo = () => (args) => class A {};
new (foo()`bar`)();
The printed code mistakenly drops parentheses around foo()`bar`:
// (Printed)
const foo = () => (args) => class A {};
new foo()`bar`();
...which will change the semantic since () after foo immediately ends NewExpression.
This bug was first observed from SvelteJS' compiler and we'd discovered same issue for a bunch of transpiler including Babel, oxc, SWC, and more.
For following input:
Playground Link
The printed code mistakenly drops parentheses around
foo()`bar`:...which will change the semantic since
()afterfooimmediately endsNewExpression.This bug was first observed from SvelteJS' compiler and we'd discovered same issue for a bunch of transpiler including Babel, oxc, SWC, and more.