Skip to content
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

Merged
merged 3 commits into from May 7, 2019

Conversation

tanhauhau
Copy link
Member

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

@nicolo-ribaudo nicolo-ribaudo added area: flow i: regression pkg: parser PR: Bug Fix 🐛 A type of pull request used for our changelog categories labels Apr 29, 2019
@@ -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)) {
Copy link
Member

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.

@babel-bot
Copy link
Collaborator

babel-bot commented Apr 29, 2019

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/10765/

@babel-bot
Copy link
Collaborator

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>
Copy link
Member

@nicolo-ribaudo nicolo-ribaudo left a 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)

@nicolo-ribaudo nicolo-ribaudo merged commit 354666a into babel:master May 7, 2019
@mrtnzlml
Copy link

mrtnzlml commented May 7, 2019

Thank you very much for the fix. Can we expect it to be released in the next patch version?

@nicolo-ribaudo
Copy link
Member

Yes!

@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Oct 3, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: flow i: regression outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: parser PR: Bug Fix 🐛 A type of pull request used for our changelog categories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flow with shebang doesn't work in @babel/parser 7.4.4
6 participants