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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: regression for module block parse #15051
Comments
Hey @fisker! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly. If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack community that typically always has someone willing to help. You can sign-up here for an invite. |
If anyone has trouble understanding the problem: start and end are swapped. |
It's weird, escaping our testing and even end-to-end testing. |
In Babel-parser 7.18.0, the program node starts at 21 and ends with 22: After #14980 it starts at 21 but ends at 8, which is worse. The previous situation is not ideal, the Program node should start at comment's start (8) and end at 21, like how we parse a comment-only plain program |
But we start at |
Yes, the module block |
Is it possible this module {
#!/usr/bin/env node
} became a thing? then shebang is not on first line. 馃槃 |
@fisker Good question! Per spec:
Because a module block can only contains optional |
Maybe too earily to consider about the estree plugin, but Eslint(Espree)'s |
馃捇
How are you using Babel?
Programmatic API (
babel.transform
,babel.parse
)Input code
Configuration file name
No response
Configuration
N/A
Current and expected behavior
Range should be
8 ~ 21
Environment
N/A
Possible solution
No response
Additional context
Possible introduced in #14980 @JLHwung
The text was updated successfully, but these errors were encountered: