diff --git a/crates/oxc_codegen/src/gen.rs b/crates/oxc_codegen/src/gen.rs index 6e08e72f2..5b20c8f38 100644 --- a/crates/oxc_codegen/src/gen.rs +++ b/crates/oxc_codegen/src/gen.rs @@ -1822,7 +1822,6 @@ impl GenExpr for YieldExpression<'_> { p.print_str("yield"); if self.delegate { p.print_ascii_byte(b'*'); - p.print_soft_space(); } if let Some(argument) = self.argument.as_ref() { p.print_soft_space(); diff --git a/crates/oxc_codegen/tests/integration/unit.rs b/crates/oxc_codegen/tests/integration/unit.rs index ac467ede2..fa0434aed 100644 --- a/crates/oxc_codegen/tests/integration/unit.rs +++ b/crates/oxc_codegen/tests/integration/unit.rs @@ -169,6 +169,7 @@ fn assignment() { #[test] fn r#yield() { + test("function * foo() { yield * 1 }", "function* foo() {\n\tyield* 1;\n}\n"); test_minify("function *foo() { yield }", "function*foo(){yield}"); test_minify("function *foo() { yield * a ? b : c }", "function*foo(){yield*a?b:c}"); test_minify("function *foo() { yield * yield * a }", "function*foo(){yield*yield*a}");