Skip to content

Commit

Permalink
fix(es/transforms): Pass unresolved_mark to simplifier instead of…
Browse files Browse the repository at this point in the history
… `top_level_mark` (#9989)

**Related issue:**

 - Closes #9981
  • Loading branch information
CPunisher authored Feb 3, 2025
1 parent 7b8bc85 commit 963b088
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/fuzzy-kangaroos-help.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
preset_env_base: patch
---

fix(es/transforms): Pass `unresolved_mark` to `simplifier` instead of `top_level_mark`
6 changes: 6 additions & 0 deletions .changeset/many-camels-chew.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
swc: patch
swc_core: patch
---

fix(es/transforms): Pass `unresolved_mark` to `simplifier` instead of `top_level_mark`
4 changes: 2 additions & 2 deletions crates/swc/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -470,13 +470,13 @@ impl Options {
match opts {
SimplifyOption::Bool(allow_simplify) => {
if *allow_simplify {
Some(simplifier(top_level_mark, Default::default()))
Some(simplifier(unresolved_mark, Default::default()))
} else {
None
}
}
SimplifyOption::Json(cfg) => Some(simplifier(
top_level_mark,
unresolved_mark,
SimplifyConfig {
dce: DceConfig {
preserve_imports_with_side_effects: cfg
Expand Down

0 comments on commit 963b088

Please sign in to comment.