Austaras
Austaras
Combined with #4414, I'd say number shouldn't be inlined blindly too.
The actual process of `terser` is when check constant conditions, evaluate left side of comparison and find out it's `aaaa`, so the whole `if` can be removed
What shallow optimizer?
That seems to be good enough for expr_simplier
What would be the potential performance impact of check is global var? It seems like need `ctxt.outer()` which need to acquire global lock
Come to revisit this, I believe proper solution for `expr_simplifier` would be separate it into two parts -- AST mangle and evaluate. Former part should be run only once before...
Maybe [here](https://github.com/swc-project/swc/blob/main/package.json#L22)?
Some thoughts, not actual work. Inlining a function call is a two phase action in swc: first you replace the function ident with the actual function, then you evaluate it....
No, the cost of `module.exports` doesn't change before and after inling unless it's referenced multiple times, which is rare as we only inline small functions
Oh, this case seems to be caused by function as a parameter would prevent iife invoke. We could optimise this easily.