Skip to content

Commit

Permalink
fix(transformer/async-generator-functions): only transform object met…
Browse files Browse the repository at this point in the history
…hod in exit_function (#7200)

close: #7175
  • Loading branch information
Dunqing committed Nov 8, 2024
1 parent 293d072 commit c82b273
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,7 @@ impl<'a, 'ctx> Traverse<'a> for AsyncGeneratorFunctions<'a, 'ctx> {
if func.r#async
&& func.generator
&& !func.is_typescript_syntax()
&& matches!(
ctx.parent(),
// `class A { async foo() {} }` | `({ async foo() {} })`
Ancestor::MethodDefinitionValue(_) | Ancestor::ObjectPropertyValue(_)
)
&& AsyncGeneratorExecutor::is_class_method_like_ancestor(ctx.parent())
{
self.executor.transform_function_for_method_definition(func, ctx);
}
Expand Down

0 comments on commit c82b273

Please sign in to comment.