8000 Switched to onEmitNode · icssjs/TypeScript@72eebdb · GitHub
[go: up one dir, main page]

Skip to content

Commit 72eebdb

Browse files
committed
Switched to onEmitNode
1 parent c4a75ba commit 72eebdb

File tree

1 file changed

+16
-18
lines changed

1 file changed

+16
-18
lines changed

src/compiler/transformers/module/system.ts

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ namespace ts {
3535
let contextObjectForFile: Identifier;
3636
let exportedLocalNames: Identifier[];
3737
let exportedFunctionDeclarations: ExpressionStatement[];
38-
const noSubstitution: Map<boolean> = {};
3938

4039
return transformSourceFile;
4140

@@ -921,24 +920,23 @@ namespace ts {
921920
}
922921

923922
function substituteAssignmentExpression(node: BinaryExpression): Expression {
924-
if (!noSubstitution[getNodeId(node)]) {
925-
noSubstitution[getNodeId(node)] = true;
926-
const left = node.left;
927-
switch (left.kind) {
928-
case SyntaxKind.Identifier:
929-
const exportDeclaration = resolver.getReferencedExportContainer(<Identifier>left);
930-
if (exportDeclaration) {
931-
return createExportExpression(<Identifier>left, node);
932-
}
933-
break;
923+
setNodeEmitFlags(node, NodeEmitFlags.NoSubstitution);
934924

935-
case SyntaxKind.ObjectLiteralExpression:
936-
case SyntaxKind.ArrayLiteralExpression:
937-
if (hasExportedReferenceInDestructuringPattern(<ObjectLiteralExpression | ArrayLiteralExpression>left)) {
938-
return substituteDestructuring(node);
939-
}
940-
break;
941-
}
925+
const left = node.left;
926+
switch (left.kind) {
927+
case SyntaxKind.Identifier:
928+
const exportDeclaration = resolver.getReferencedExportContainer(<Identifier>left);
929+
if (exportDeclaration) {
930+
return createExportExpression(<Identifier>left, node);
931+
}
932+
break;
933+
934+
case SyntaxKind.ObjectLiteralExpression:
935+
case SyntaxKind.ArrayLiteralExpression:
936+
if (hasExportedReferenceInDestructuringPattern(<ObjectLiteralExpression | ArrayLiteralExpression>left)) {
937+
return substituteDestructuring(node);
938+
}
939+
break;
942940
}
943941

944942
return node;

0 commit comments

Comments
 (0)
0