-
Notifications
You must be signed in to change notification settings - Fork 21
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
Renaming of variables? #15
Comments
Should say, if it was purposeful and the collision issue is an understood and calculated risk, figuring its not a common use case, that's cool. Not sure what the mitigation would be in other than to check variables in scope... or to be in scope... which may be a bridge entirely too far given the odd use case. |
Yeah, I realised this the other day but hadn't got round to creating an issue. It is purposeful - if you're in non-strict mode, you get this result... (function () {
'use strict';
var bar = require('foo')
bar.what();
}).call(global); ...which is both more readable than Bundling is a bit trickier, because you need a variable name based on the module ID rather than the import name (otherwise it might vary within the bundle), and you have to deconflict across all modules. Still do-able though |
@dbashford This behaves a bit better in 0.4.7 - default imports like |
Turns into this
So
bar
is renamed tofoo
. If I have afoo
or declare afoo
I'll get a collision. Also debugging could become a pain with the name change, but source maps take care of that (just haven't got to that yet).Guess the renaming was purposeful?
The text was updated successfully, but these errors were encountered: