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 issue with generated "use strict" directives #1

Merged
merged 1 commit into from
Dec 10, 2017

Conversation

marcioj
Copy link
Contributor

@marcioj marcioj commented Dec 8, 2017

Hi, babel-to-estree is being used by parcel-bundler to convert the javascript ASTs. This AST might have new nodes added by babel plugins, but those nodes have no loc information.
This PR changes the behavior to get the first body item with a loc instead of relying on body[0].

@rattrayalex
Copy link
Contributor

Cool, thanks for the fix & good luck with parcel-bundler!

Looks like this will probably be removed as a dependency in parcel-bundler/parcel#157 – if that does not occur, let me know and I'd be happy to make either you or @DeMoorJasper a collaborator on this repo, since I do not actively use or work on it.

@rattrayalex
Copy link
Contributor

Published in 0.0.3 https://www.npmjs.com/package/babel-to-estree

@marcioj marcioj deleted the marcioj.loc-error branch December 10, 2017 22:41
@marcioj
Copy link
Contributor Author

marcioj commented Dec 10, 2017

Thanks @rattrayalex !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants