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

Function serializeEntityNameAsExpression

test/fixtures/snapshot/typescript.js:93018–93030  ·  view source on GitHub ↗

* Serializes an entity name as an expression for decorator type metadata. * * @param node The entity name to serialize.

(node)

Source from the content-addressed store, hash-verified

93016 * @param node The entity name to serialize.
93017 */
93018 function serializeEntityNameAsExpression(node) {
93019 switch (node.kind) {
93020 case 79 /* SyntaxKind.Identifier */:
93021 // Create a clone of the name with a new parent, and treat it as if it were
93022 // a source tree node for the purposes of the checker.
93023 var name = ts.setParent(ts.setTextRange(ts.parseNodeFactory.cloneNode(node), node), node.parent);
93024 name.original = undefined;
93025 ts.setParent(name, ts.getParseTreeNode(currentLexicalScope)); // ensure the parent is set to a parse tree node.
93026 return name;
93027 case 161 /* SyntaxKind.QualifiedName */:
93028 return serializeQualifiedNameAsExpression(node);
93029 }
93030 }
93031 /**
93032 * Serializes an qualified name as an expression for decorator type metadata.
93033 *

Calls 1

Tested by

no test coverage detected