Skip to content

Commit

Permalink
fix(codegen): print yield * ident correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
Boshen committed Dec 24, 2024
1 parent 0562830 commit 728ed20
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 0 additions & 1 deletion crates/oxc_codegen/src/gen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
1 change: 1 addition & 0 deletions crates/oxc_codegen/tests/integration/unit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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}");
Expand Down

0 comments on commit 728ed20

Please sign in to comment.