Fix overzealous renaming of emit helpers in es module emit (#36541)

This commit is contained in:
Ron Buckton
2020-01-31 10:41:47 -08:00
committed by GitHub
parent 24d8f795b2
commit fcf28506aa
10 changed files with 237 additions and 1 deletions

View File

@@ -105,7 +105,9 @@ namespace ts {
*/
function onEmitNode(hint: EmitHint, node: Node, emitCallback: (hint: EmitHint, node: Node) => void): void {
if (isSourceFile(node)) {
helperNameSubstitutions = createMap<Identifier>();
if ((isExternalModule(node) || compilerOptions.isolatedModules) && compilerOptions.importHelpers) {
helperNameSubstitutions = createMap<Identifier>();
}
previousOnEmitNode(hint, node, emitCallback);
helperNameSubstitutions = undefined;
}