Remove uses of getNodeId in compiler outside of checker.

This commit is contained in:
Daniel Rosenwasser 2021-11-06 10:41:57 +00:00 committed by GitHub
parent ca13132e84
commit 6f76b625a1
2 changed files with 6 additions and 6 deletions

View file

@ -46,7 +46,7 @@ namespace ts {
/** Whether the async function contains an element access on super (`super[x]`). */
let hasSuperElementAccess: boolean;
/** A set of node IDs for generated super accessors (variable statements). */
const substitutedSuperAccessors: boolean[] = [];
const substitutedSuperAccessors = new Set<Node>();
let contextFlags: ContextFlags = 0;
@ -503,7 +503,7 @@ namespace ts {
enableSubstitutionForAsyncMethodsWithSuper();
if (capturedSuperProperties.size) {
const variableStatement = createSuperAccessVariableStatement(factory, resolver, node, capturedSuperProperties);
substitutedSuperAccessors[getNodeId(variableStatement)] = true;
substitutedSuperAccessors.add(variableStatement);
insertStatementsAfterStandardPrologue(statements, [variableStatement]);
}
}
@ -613,7 +613,7 @@ namespace ts {
}
}
// Disable substitution in the generated super accessor itself.
else if (enabledSubstitutions && substitutedSuperAccessors[getNodeId(node)]) {
else if (enabledSubstitutions && substitutedSuperAccessors.has(node)) {
const savedEnclosingSuperContainerFlags = enclosingSuperContainerFlags;
enclosingSuperContainerFlags = 0;
previousOnEmitNode(hint, node, emitCallback);

View file

@ -70,7 +70,7 @@ namespace ts {
/** Whether the async function contains an element access on super (`super[x]`). */
let hasSuperElementAccess: boolean;
/** A set of node IDs for generated super accessors. */
const substitutedSuperAccessors: boolean[] = [];
const substitutedSuperAccessors = new Set<Node>();
return chainBundle(context, transformSourceFile);
@ -972,7 +972,7 @@ namespace ts {
if (emitSuperHelpers) {
enableSubstitutionForAsyncMethodsWithSuper();
const variableStatement = createSuperAccessVariableStatement(factory, resolver, node, capturedSuperProperties);
substitutedSuperAccessors[getNodeId(variableStatement)] = true;
substitutedSuperAccessors.add(variableStatement);
insertStatementsAfterStandardPrologue(statements, [variableStatement]);
}
@ -1087,7 +1087,7 @@ namespace ts {
}
}
// Disable substitution in the generated super accessor itself.
else if (enabledSubstitutions && substitutedSuperAccessors[getNodeId(node)]) {
else if (enabledSubstitutions && substitutedSuperAccessors.has(node)) {
const savedEnclosingSuperContainerFlags = enclosingSuperContainerFlags;
enclosingSuperContainerFlags = 0 as NodeCheckFlags;
previousOnEmitNode(hint, node, emitCallback);