-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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`.
- Loading branch information
Showing
45 changed files
with
4,435 additions
and
3,339 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
#!/usr/bin/env bash | ||
set -eu | ||
set -eux | ||
|
||
export RUST_LOG=swc_ecma_minifier=trace | ||
|
||
# To prevent regression, we run base test before real tests. | ||
cargo test --test compress ${1-base_exec} -q --all-features | ||
cargo test --test compress -q --all-features ${1-base_exec} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.