Commit Graph

2 Commits

Author SHA1 Message Date
강동윤
20ce326909
feat(es/minifer): Improve minifier (#2229)
swc_ecma_minifier:
 - `if_return`: Allow side-effect-free statements to come after `if_return`.
 - `collapse_vars`: Move variables without init to first.
 - `analyzer`: Remove useless fields.
 - Don't drop `return` tokens if there's a finally block.
 - `drop_return_value`: Drop side-effect-free return arguments.
 - `make_sequences`: Don't inject `void 0` to return args.
 - `if_terminate`: Move to the pure optimizer.
 - Fix a bug related to `RegExp`.
2021-09-16 04:23:33 +00:00
강동윤
c8b46bf6db
feat(es/minifier): Implement more rules (#2183)
swc_ecma_codegen:
 - Don't panic on `Pat::Invalid`.
 - Fix codegen of unary minus. (#2213)

swc_ecma_minifier:
 - Remove identifier of function expressions if a variable with same name exists.
 - `sequences`: Merge into the argument of a throw statement.
 - Use `ignore_return_value` for `void` expressions.
 - Improve inlining.
 - Drop last `return` if the return value is not used.
 - `sequences`: Merge `c++; use(c)` as `use(++c)`.
 - `sequences`: Merge assignments with an operator.
 - `comparisons`: Optimize the comparison operator if type is equivalent.
 - Fix `negate_cost`.
 - `unused`: Fix order or variable initalizer when variables are dropped.
 - Fix `top_retain` option.
 - `if_return`: Don't merge nested if it's wrong to do so. (#2214)
 - Fix negation of `if_return`.
2021-09-08 09:45:39 +00:00