diff --git a/crates/oxc_transformer/src/common/arrow_function_converter.rs b/crates/oxc_transformer/src/common/arrow_function_converter.rs index ac3ffe31f37d1..9de158b3e68af 100644 --- a/crates/oxc_transformer/src/common/arrow_function_converter.rs +++ b/crates/oxc_transformer/src/common/arrow_function_converter.rs @@ -483,7 +483,7 @@ impl<'a> ArrowFunctionConverter<'a> { match ancestor { // `class A { async foo() {} }` Ancestor::MethodDefinitionValue(_) => true, - // Only `({ async foo() {} })` does not include non-method like `({ async foo: function() {} })`, + // Only `({ async foo() {} })` does not include non-method like `({ foo: async function() {} })`, // because it's just a property with a function value Ancestor::ObjectPropertyValue(property) => *property.method(), _ => false, diff --git a/crates/oxc_transformer/src/es2017/async_to_generator.rs b/crates/oxc_transformer/src/es2017/async_to_generator.rs index 3b53de1b84311..9ebcb42db1b61 100644 --- a/crates/oxc_transformer/src/es2017/async_to_generator.rs +++ b/crates/oxc_transformer/src/es2017/async_to_generator.rs @@ -755,7 +755,7 @@ impl<'a, 'ctx> AsyncGeneratorExecutor<'a, 'ctx> { match ancestor { // `class A { async foo() {} }` Ancestor::MethodDefinitionValue(_) => true, - // Only `({ async foo() {} })` does not include non-method like `({ async foo: function() {} })`, + // Only `({ async foo() {} })` does not include non-method like `({ foo: async function() {} })`, // because it's just a property with a function value Ancestor::ObjectPropertyValue(property) => *property.method(), _ => false,