Skip to content

Commit

Permalink
fix(es/codegen): Fix ends_with_alpha_num (#9720)
Browse files Browse the repository at this point in the history
**Related issue:**

 - Closes #9719
  • Loading branch information
kdy1 authored Nov 6, 2024
1 parent c45e08f commit 569c799
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changeset/foo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
swc_core: patch
swc_ecma_codegen: patch
---

fix(es/codegen): Fix binary expression formatting
2 changes: 1 addition & 1 deletion crates/swc_ecma_codegen/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ impl EndsWithAlphaNum for Expr {
Expr::Update(n) => n.prefix && n.arg.ends_with_alpha_num(),

Expr::OptChain(n) => match n.base.as_ref() {
OptChainBase::Member(base) => base.prop.is_computed(),
OptChainBase::Member(base) => !base.prop.is_computed(),
OptChainBase::Call(_) => false,
},

Expand Down

0 comments on commit 569c799

Please sign in to comment.