MCPcopy Index your code
hub / github.com/nodejs/node / getClassAliasIfNeeded

Function getClassAliasIfNeeded

test/fixtures/snapshot/typescript.js:94060–94068  ·  view source on GitHub ↗

* Gets a local alias for a class declaration if it is a decorated class with an internal * reference to the static side of the class. This is necessary to avoid issues with * double-binding semantics for the class name.

(node)

Source from the content-addressed store, hash-verified

94058 * double-binding semantics for the class name.
94059 */
94060 function getClassAliasIfNeeded(node) {
94061 if (resolver.getNodeCheckFlags(node) & 16777216 /* NodeCheckFlags.ClassWithConstructorReference */) {
94062 enableSubstitutionForClassAliases();
94063 var classAlias = factory.createUniqueName(node.name && !ts.isGeneratedIdentifier(node.name) ? ts.idText(node.name) : "default");
94064 classAliases[ts.getOriginalNodeId(node)] = classAlias;
94065 hoistVariableDeclaration(classAlias);
94066 return classAlias;
94067 }
94068 }
94069 function getClassPrototype(node) {
94070 return factory.createPropertyAccessExpression(factory.getDeclarationName(node), "prototype");
94071 }

Calls 2

hoistVariableDeclarationFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…