Skip to content

Commit 2184be8

Browse files
committed
addressed PR feedback
1 parent 4a919d4 commit 2184be8

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/compiler/emitter.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5044,23 +5044,29 @@ if (typeof __param !== "function") __param = function (paramIndex, decorator) {
50445044

50455045
// define an export star helper function
50465046
write(`function ${exportStarFunction}(m) {`);
5047+
increaseIndent();
50475048
writeLine();
5048-
write(` for(var n in m) {`);
5049+
write(`for(var n in m) {`);
5050+
increaseIndent();
50495051
writeLine();
5050-
write(` if (n !== "default"`);
5052+
write(`if (n !== "default"`);
50515053
if (localNames) {
50525054
write(`&& !${localNames}.hasOwnProperty(n)`);
50535055
}
50545056
write(`) ${exportFunctionForFile}(n, m[n]);`);
5057+
decreaseIndent();
50555058
writeLine();
5056-
write(" }");
5059+
write("}");
5060+
decreaseIndent();
50575061
writeLine();
50585062
write("}")
50595063

50605064
return exportStarFunction;
50615065
}
50625066

50635067
function writeExportedName(node: Identifier | Declaration): void {
5068+
// do not record default exports
5069+
// they are local to module and never overwritten (explicitly skipped) by star export
50645070
if (node.kind !== SyntaxKind.Identifier && node.flags & NodeFlags.Default) {
50655071
return;
50665072
}

0 commit comments

Comments
 (0)