From 571f8c5d08362d0be918e857cb802a561f9959ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Wed, 6 Nov 2024 21:20:51 +0900 Subject: [PATCH 1/2] fix --- crates/swc_ecma_codegen/src/util.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/swc_ecma_codegen/src/util.rs b/crates/swc_ecma_codegen/src/util.rs index cba38407b0c2..9ee6ad134f3b 100644 --- a/crates/swc_ecma_codegen/src/util.rs +++ b/crates/swc_ecma_codegen/src/util.rs @@ -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, }, From 57bb54f2edc096a7b2ad3a539ecb74ea1d9fafef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Wed, 6 Nov 2024 21:27:24 +0900 Subject: [PATCH 2/2] foo --- .changeset/foo.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changeset/foo.md diff --git a/.changeset/foo.md b/.changeset/foo.md new file mode 100644 index 000000000000..b3cee802f61b --- /dev/null +++ b/.changeset/foo.md @@ -0,0 +1,6 @@ +--- +swc_core: patch +swc_ecma_codegen: patch +--- + +fix(es/codegen): Fix binary expression formatting