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
[cjs] Skip duplicate reexported bindings in namespace reexports #11739
[cjs] Skip duplicate reexported bindings in namespace reexports #11739
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 87938ed:
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/28760/ |
@@ -236,6 +236,7 @@ function buildNamespaceReexport(metadata, namespace, loose) { | |||
Object.keys(NAMESPACE).forEach(function(key) { | |||
if (key === "default" || key === "__esModule") return; | |||
VERIFY_NAME_LIST; | |||
if (key in EXPORTS && EXPORTS[key] === NAMESPACE[key]) return; |
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.
Since this is technically not spec compliant, could you add a comment explaining the reason to do it?
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.
Done (directly above the template string)
fa8bd25
to
d7f8014
Compare
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.
Can you update the test fixtures?
d7f8014
to
199055a
Compare
Done |
199055a
to
341a776
Compare
341a776
to
87938ed
Compare
Thanks! |
Namespace reexports: skip already added reexports on the
exports
object if they are strictly equal (as suggested in #11710 (comment)).Questions:
Object.defineProperty
does this automatically). However, the order of the objects should be the same (because both skip if already set).