Implement GetSpan for JSXChild (#487)

This commit is contained in:
u9g 2023-06-27 12:26:47 -04:00 committed by GitHub
parent 0a76483907
commit 780e17707b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -336,3 +336,15 @@ impl GetSpan for ImportDeclarationSpecifier {
}
}
}
impl<'a> GetSpan for JSXChild<'a> {
fn span(&self) -> Span {
match self {
Self::Element(element) => element.span,
Self::ExpressionContainer(container) => container.span,
Self::Text(text) => text.span,
Self::Fragment(fragment) => fragment.span,
Self::Spread(spread) => spread.span,
}
}
}