From f873139a0f4f8a649868d155bfa21abb7c8aec0b Mon Sep 17 00:00:00 2001 From: Boshen <1430279+Boshen@users.noreply.github.com> Date: Tue, 24 Dec 2024 04:17:50 +0000 Subject: [PATCH] feat(codegen): minify `for (_ of [])` -> `for(_ of[])` (#8086) --- crates/oxc_codegen/src/gen.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/oxc_codegen/src/gen.rs b/crates/oxc_codegen/src/gen.rs index d0ab1eb340c6b..b3bfcf75532fe 100644 --- a/crates/oxc_codegen/src/gen.rs +++ b/crates/oxc_codegen/src/gen.rs @@ -416,7 +416,8 @@ impl Gen for ForOfStatement<'_> { self.left.print(p, ctx); p.print_soft_space(); p.print_space_before_identifier(); - p.print_str("of "); + p.print_str("of"); + p.print_soft_space(); self.right.print_expr(p, Precedence::Comma, Context::empty()); p.print_ascii_byte(b')'); p.print_body(&self.body, false, ctx);