Skip to content

Commit 569c799

Browse files
authored
fix(es/codegen): Fix ends_with_alpha_num (#9720)
**Related issue:** - Closes #9719
1 parent c45e08f commit 569c799

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.changeset/foo.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
swc_core: patch
3+
swc_ecma_codegen: patch
4+
---
5+
6+
fix(es/codegen): Fix binary expression formatting

crates/swc_ecma_codegen/src/util.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ impl EndsWithAlphaNum for Expr {
7070
Expr::Update(n) => n.prefix && n.arg.ends_with_alpha_num(),
7171

7272
Expr::OptChain(n) => match n.base.as_ref() {
73-
OptChainBase::Member(base) => base.prop.is_computed(),
73+
OptChainBase::Member(base) => !base.prop.is_computed(),
7474
OptChainBase::Call(_) => false,
7575
},
7676

0 commit comments

Comments
 (0)