diff --git a/crates/swc_ecma_transforms_compat/src/es2017/async_to_generator.rs b/crates/swc_ecma_transforms_compat/src/es2017/async_to_generator.rs index 4e3b1a91528..fb54fba4a4a 100644 --- a/crates/swc_ecma_transforms_compat/src/es2017/async_to_generator.rs +++ b/crates/swc_ecma_transforms_compat/src/es2017/async_to_generator.rs @@ -353,8 +353,10 @@ impl Actual { wrapper.function = make_fn_ref(fn_expr); *expr = wrapper.into(); - if !in_iife && let Some(c) = &mut self.comments { - c.add_pure_comment(expr.span().lo) + if !in_iife { + if let Some(c) = &mut self.comments { + c.add_pure_comment(expr.span().lo) + } } } @@ -374,8 +376,10 @@ impl Actual { wrapper.function = make_fn_ref(fn_expr); *expr = wrapper.into(); - if !in_iife && let Some(c) = &mut self.comments { - c.add_pure_comment(expr.span().lo) + if !in_iife { + if let Some(c) = &mut self.comments { + c.add_pure_comment(expr.span().lo) + } } }