MCPcopy Create free account
hub / github.com/nodejs/node / trySubstituteNamespaceExportedName

Function trySubstituteNamespaceExportedName

test/fixtures/snapshot/typescript.js:94203–94219  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

94201 return undefined;
94202 }
94203 function trySubstituteNamespaceExportedName(node) {
94204 // If this is explicitly a local name, do not substitute.
94205 if (enabledSubstitutions & applicableSubstitutions && !ts.isGeneratedIdentifier(node) && !ts.isLocalName(node)) {
94206 // If we are nested within a namespace declaration, we may need to qualifiy
94207 // an identifier that is exported from a merged namespace.
94208 var container = resolver.getReferencedExportContainer(node, /*prefixLocals*/ false);
94209 if (container && container.kind !== 305 /* SyntaxKind.SourceFile */) {
94210 var substitute = (applicableSubstitutions & 2 /* TypeScriptSubstitutionFlags.NamespaceExports */ && container.kind === 261 /* SyntaxKind.ModuleDeclaration */) ||
94211 (applicableSubstitutions & 8 /* TypeScriptSubstitutionFlags.NonQualifiedEnumMembers */ && container.kind === 260 /* SyntaxKind.EnumDeclaration */);
94212 if (substitute) {
94213 return ts.setTextRange(factory.createPropertyAccessExpression(factory.getGeneratedNameForNode(container), node),
94214 /*location*/ node);
94215 }
94216 }
94217 }
94218 return undefined;
94219 }
94220 function substitutePropertyAccessExpression(node) {
94221 return substituteConstantValue(node);
94222 }

Calls

no outgoing calls

Tested by

no test coverage detected