mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
fix(codegen): print yield * ident correctly
This commit is contained in:
parent
0562830549
commit
728ed20c1c
2 changed files with 1 additions and 1 deletions
|
|
@ -1822,7 +1822,6 @@ impl GenExpr for YieldExpression<'_> {
|
||||||
p.print_str("yield");
|
p.print_str("yield");
|
||||||
if self.delegate {
|
if self.delegate {
|
||||||
p.print_ascii_byte(b'*');
|
p.print_ascii_byte(b'*');
|
||||||
p.print_soft_space();
|
|
||||||
}
|
}
|
||||||
if let Some(argument) = self.argument.as_ref() {
|
if let Some(argument) = self.argument.as_ref() {
|
||||||
p.print_soft_space();
|
p.print_soft_space();
|
||||||
|
|
|
||||||
|
|
@ -169,6 +169,7 @@ fn assignment() {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn r#yield() {
|
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 }", "function*foo(){yield}");
|
||||||
test_minify("function *foo() { yield * a ? b : c }", "function*foo(){yield*a?b:c}");
|
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}");
|
test_minify("function *foo() { yield * yield * a }", "function*foo(){yield*yield*a}");
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue