Repository navigation
Update __exportStar helper to skip default and __esModule members - #37236
Wesley Wigham (weswigham) merged 4 commits into
Conversation
| text: ` | ||
| var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
| for (var p in m) if (!exports.hasOwnProperty(p)) __createBinding(exports, m, p); | ||
| for (var p in m) if (p !== "default" && p !== "__esModule" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); |
There was a problem hiding this comment.
Won't __esModule always be skipped because we emit it unconditionally anyways?
There was a problem hiding this comment.
Hm, fair, yeah.
|
i think this not a good way for avoid bug u will see bug happen again when run e1.ts e1.ts export * from './e2'
export function abc()
{
}e2.ts export function abc()
{
} |
|
bluelovers (@bluelovers) We hoist an undefined member assignment so that actually works just fine (as the hoisted assignment blocks us from overwriting it with the |
|
Ron Buckton (@rbuckton) you think we should hoist an assignment to |
|
every will every export after |
|
Except it doesn't, because export * from './e2'
export function abc()
{
}compiles to exports.abc = void 0;
__exportStar(require("./e2"), exports);
function abc() {
}
exports.abc = abc;and that hoisted |
|
oh, i see it already fix in current next version my version still at |
|
Wesley Wigham (@weswigham) no, I don't think we should hoist an assignment for I think the behavior of the helper to explicitly skip |
|
how about make a |
Fixes #37234