Fix transform of named import with shadowed namespace import#15898
Conversation
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/55416/ |
|
Thank you! Could you add some tests in If it is the first time that you contribute to Babel, follow these steps: (you need to have
|
Hi, nicola, I updated code and add a input.mjs for test. But expected output is to throw an Error for now. I don't know how to make jest know that the result of my input.mjs should be such an error in babel system. |
Can this temp PR be merged and pub a patch version for now ? As our team met this problem in production for twice. |
There was a problem hiding this comment.
Instead of throwing an error, could you try fixing this issue by updating this check to be "if there is at least one namespace import and zero other imports"?
Also, you could update the line below to use destructuring as described in the comment in the code, since we don't compile it as loose anymore :)
Thx for your advice. It is done. And to be on the safe side, I do not revert the changes of throwing error. |
Since we have now tests to make sure that it works, I would prefer to revert it :) It adds quite a bit of noise to the code, just for an error that is never expected to happen. |
It sounds reasonable. It is reverted. |
d1511fe to
60af27f
Compare
687103a to
95b8db6
Compare
Uh oh!
There was an error while loading. Please reload this page.