-
Notifications
You must be signed in to change notification settings - Fork 26
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
Add support for Babel 7.12 reexports #16
Conversation
@@ -398,6 +398,61 @@ function tryParseObjectDefineOrKeys (keys) { | |||
} | |||
else break; | |||
|
|||
// `if (` IDENTIFIER$2 `in` EXPORTS_IDENTIFIER `&&` EXPORTS_IDENTIFIER `[` IDENTIFIER$2 `] ===` IDENTIFIER$1 `[` IDENTIFIER$2 `]) return` `;`? | |||
if (ch === 105/*i*/ && source.startsWith('f ', pos + 1)) { |
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.
Note: I copied 'f '
from other parts of the code, but I think it could also be f(
?
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.
Nice catch, yes we should probably allow the missing space.
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.
Thanks so much for looking into this @nicolo-ribaudo! I'm going to go ahead and merge and release to upstream asap. And I thought you were working on scope problems there too :)
@@ -398,6 +398,61 @@ function tryParseObjectDefineOrKeys (keys) { | |||
} | |||
else break; | |||
|
|||
// `if (` IDENTIFIER$2 `in` EXPORTS_IDENTIFIER `&&` EXPORTS_IDENTIFIER `[` IDENTIFIER$2 `] ===` IDENTIFIER$1 `[` IDENTIFIER$2 `]) return` `;`? | |||
if (ch === 105/*i*/ && source.startsWith('f ', pos + 1)) { |
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.
Nice catch, yes we should probably allow the missing space.
In Babel 7.12, we changed the output for
export * from "mod"
to better simulate esm semantics:var _mod = require("mod"); Object.keys(_mod).forEach(function (key) { if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _mod[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { return _mod[key]; } }); });
This PR updates
cjs-module-lexer
to also recognize the new output.