-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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 "module" external helpers output #6377
Conversation
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/5167/ |
I actually prefer this PR, since it removes the special-casing for keyword helpers. |
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.
For sure the overall code is simpler - I shouldnt be afraid restructuring the functions in build-external-helpers
so much, it would certainly help to make my life simpler.
This however doesn't do good by keywordHelpers
, in module they are not namespaced and we cannot keep function typeof(obj) {...}
- need to rename it and export as renamed back:
export { _typeof as typeof }
function _typeof(obj) {...}
body.unshift( | ||
t.exportNamedDeclaration( | ||
null, | ||
Object.keys(refs).map(name => { |
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.
havent thought about that, nice!
Also I have added this if statement in order to handle exported identifiers (such as |
@Andarist Ahh, good point about I'm not sure I follow what you're saying about |
This is perfect! 🎉 |
This is an alternative to #6367 that I tries to keep things a little simpler.