Span for reserved keywords #5385
Unanswered
magic-akari
asked this question in
Q&A
Replies: 1 comment
-
Maybe? I considered changing |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Is it worth saving span for reserved keywords?
I found this issue when I was investigating the comments of
export default
.Input
SWC
Babel
tsc
Rome
What the Rome tool shows is the clearest, and you can see directly that it stores information about the
default
keyword in the AST.If we expect the comments surrounding the keywords to be output, then we would have to store some additional span information.
Is this worth it?
And I found more unit test cases in tsc repo. For example
The comments around the
while
are lost in SWC output.Note: esbuild always drops comments for performance concern.
Beta Was this translation helpful? Give feedback.
All reactions