fix(codegen): print yield * ident correctly

This commit is contained in:
Boshen 2024-12-24 21:57:58 +08:00
parent 0562830549
commit 728ed20c1c
No known key found for this signature in database
GPG key ID: 67715A371E534061
2 changed files with 1 additions and 1 deletions

View file

@ -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();

View file

@ -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}");