-
-
Notifications
You must be signed in to change notification settings - Fork 485
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
JSXIdentifierReference
type
#3528
Comments
reference_id
field to JSXIdentifier
in some positionsJSXIdentifierReference
type
I confirmed with tsc, which uses a plain export type JsxTagNameExpression =
| Identifier
| ThisExpression
| JsxTagNamePropertyAccess
| JsxNamespacedName
; which means we can remove pub enum JSXElementName<'a> {
/// `<Apple />`
IdentifierReference(Box<'a, IdentifierReference<'a>>),
/// `<div />
IdentifierName(Box<'a, IdentifierName<'a>>),
/// `<Apple:Orange />`
NamespacedName(Box<'a, JSXNamespacedName<'a>>),
/// `<Apple.Orange />`
MemberExpression(Box<'a, JSXMemberExpression<'a>>),
} but, in order to make it compatible with estree, we need to add at least one new AST node :-( |
Ditto for: pub enum JSXMemberExpressionObject<'a> {
/// `<Apple.Orange />`
IdentifierReference(Box<'a, IdentifierReference<'a>>),
/// `<div.weird />`
IdentifierName(Box<'a, IdentifierName<'a>>),
/// `<Apple.Orange.Banana />` / `<div.weird.bizarre />`
MemberExpression(Box<'a, JSXMemberExpression<'a>>),
} I think we can use It's unclear to me how namespaces work. Is |
Looks like |
Foo
in<Foo />
is equivalent to anIdentifierReference
. It should have areference_id
, and semantic should resolve its binding.JSXIdentifier
is also used in other positions e.g. as aJSXAttributeName
, so would probably need a separate typeJSXIdentifierReference
for this specific use.Could also differentiate between
<div />
and<Div />
in parser, withJSXIdentifierReference
only used for the latter.The text was updated successfully, but these errors were encountered: