mirror of
https://github.com/swc-project/swc.git
synced 2024-12-24 22:22:34 +03:00
93a264c9a4
**Description:** The problem arises in L235 of swc_ecma_transforms_base/src/rename/mod.rs ```rs unit!(visit_mut_fn_decl, FnDecl, true); ``` which calls `get_map` and evals to ```rs node.visit_children_with(&mut v); ``` with `FnDecl` and `Analyzer` in L132. However, in `Analyzer`, a visit to raw function was not overloaded, so function arguments and function body are considered different scopes. **Related issue:** - Closes #7261. |
||
---|---|---|
.. | ||
benches | ||
examples | ||
fuzz | ||
inputs | ||
scripts | ||
src | ||
tests | ||
.eslintrc | ||
.gitignore | ||
Cargo.toml | ||
package.json | ||
README.md | ||
yarn.lock |
Minifier
EcmaScript minifier for the SWC project. This is basically a port of terser.
Note
Currently name mangler is very simple. To focus on creating a MVP, I (kdy1) will use simple logic for name mangler and implement the content-aware name mangler after publishing first non-beta version.
Debugging tips
If the output contains variables named e
, t
, n
it typically means the original library is published in a minified form and the input contains eval
.
The current swc name mangler does not do anything if eval
is used.
Profiling the minifier
From mac os x, run
./scripts/instrument/all.sh path/to/input/dir