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

Function substituteIdentifier

test/fixtures/snapshot/typescript.js:101524–101534  ·  view source on GitHub ↗

* Hooks substitutions for non-expression identifiers.

(node)

Source from the content-addressed store, hash-verified

101522 * Hooks substitutions for non-expression identifiers.
101523 */
101524 function substituteIdentifier(node) {
101525 // Only substitute the identifier if we have enabled substitutions for block-scoped
101526 // bindings.
101527 if (enabledSubstitutions & 2 /* ES2015SubstitutionFlags.BlockScopedBindings */ && !ts.isInternalName(node)) {
101528 var original = ts.getParseTreeNode(node, ts.isIdentifier);
101529 if (original && isNameOfDeclarationWithCollidingName(original)) {
101530 return ts.setTextRange(factory.getGeneratedNameForNode(original), node);
101531 }
101532 }
101533 return node;
101534 }
101535 /**
101536 * Determines whether a name is the name of a declaration with a colliding name.
101537 * NOTE: This function expects to be called with an original source tree node.

Callers 1

onSubstituteNodeFunction · 0.85

Tested by

no test coverage detected