Bug report or Feature request?
Bug (regression causing obviously suboptimal code)
Version (complete output of terser -V or specific git commit)
4.3.9
Complete CLI command or minify() options used
terser
terser input
foo(function(){});
terser output or error
foo((function(){}));
Expected result
foo(function(){});
git bisect says that the bug/suboptimal output got introduced in https://github.com/terser/terser/pull/433
This is intended. It improves parsing speed on most browsers.
Use the output option wrap_func_args=false to disable this. It's enabled by default now.
@fabiosantoscode - should disable this option by default in light of this:
"The V8 team recommends against using optimize-js nowadays: https://t.co/vSjB1StJtp"
https://twitter.com/mathias/status/1185086954855108608
/cc @mathiasbynens
Repeating the above link (currently hidden behind a t.co redirect): https://v8.dev/blog/preparser#pife
Most helpful comment
Repeating the above link (currently hidden behind a t.co redirect): https://v8.dev/blog/preparser#pife