-
-
Notifications
You must be signed in to change notification settings - Fork 503
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove JSXMemberExpressionObject::Identifier
variant
#5353
Comments
I've considered it, but it doesn't work. In this case: |
I think it still works for So in JSXMemberExpression {
object: JSXMemberExpressionObject::MemberExpression(JSXMemberExpression {
object: JSXMemberExpressionObject::IdentifierReference( IdentifierReference(A) ),
property: JSXIdentifier(B),
}),
property: JSXIdentifier(C),
} So, unless I'm mistaken, there are no circumstances in which |
Ahh, My brain is broken. You are right. I've made a mistake here oxc/crates/oxc_ast/src/ast_impl/jsx.rs Lines 63 to 65 in fe62687
Doesn't have any tests failed 🥲 |
…oo>` is inside an arrow function (#5356) Fixes: #5353 (comment)
Currently we parse all JSX member expressions as an
IdentifierReference
followed by one or moreJSXIdentifier
s.This is the case regardless of whether the first identifier is upper case or not. i.e.
foo
in<foo.bar>
is interpreted as anIdentifierReference
, even though in<foo>
it'd be a plainIdentifierName
.This behavior aligns with Babel: Babel REPL
Therefore we can remove the
JSXMemberExpressionObject::Identifier
variant - it's not possible to create one - it's always anIdentifierReference
, another nestedJSXMemberExpression
, orthis
(#5352).It'll be easier to do this once we've closed #5352.
The text was updated successfully, but these errors were encountered: