You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Stack up to #7148 contains a few places where it checks if a Function is an object method with matches!(parent, Ancestor::ObjectPropertyValue(_)). I think the code it's trying to match is:
obj={asyncfunctionfoo(){}};
But it will also match where the function is a property value, not a method:
obj={foo: asyncfunction(){}};
I think also need a check if object_prop.method to be able to tell the difference between the two.
Personally, I think it'd be ideal if AST didn't use ObjectProperty for both properties and methods, to avoid this confusing ambiguity. oxc-project/backlog#142
The text was updated successfully, but these errors were encountered:
Stack up to #7148 contains a few places where it checks if a
Function
is an object method withmatches!(parent, Ancestor::ObjectPropertyValue(_))
. I think the code it's trying to match is:But it will also match where the function is a property value, not a method:
I think also need a check
if object_prop.method
to be able to tell the difference between the two.oxc/crates/oxc_transformer/src/common/arrow_function_converter.rs
Lines 401 to 404 in b57d5a5
oxc/crates/oxc_transformer/src/es2017/async_to_generator.rs
Lines 136 to 140 in c307e1b
oxc/crates/oxc_transformer/src/es2018/async_generator_functions/mod.rs
Lines 148 to 152 in c307e1b
Personally, I think it'd be ideal if AST didn't use
ObjectProperty
for both properties and methods, to avoid this confusing ambiguity. oxc-project/backlog#142The text was updated successfully, but these errors were encountered: