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
fix: allow shebang directive #9922
Conversation
tanhauhau
commented
Apr 29, 2019
Q | A |
---|---|
Fixed Issues? | Fixes #9921 |
Patch: Bug Fix? | |
Major: Breaking Change? | |
Minor: New Feature? | |
Tests Added + Pass? | Yes |
Documentation PR Link | |
Any Dependency Changes? | |
License | MIT |
@@ -96,7 +96,7 @@ export default (superClass: Class<Parser>): Class<Parser> => | |||
} | |||
|
|||
finishToken(type: TokenType, val: any): void { | |||
if (!(type === tt.string || type === tt.semi)) { | |||
if (![tt.string, tt.semi, tt.interpreterDirective].includes(type)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer that we stick with ===
since this function is called very often and making the temporary array and iterating could be slower.
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/10765/ |
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/10745/ |
Co-Authored-By: tanhauhau <tanhauhau@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Needs make fix
to run prettier)
Thank you very much for the fix. Can we expect it to be released in the next patch version? |
Yes! |