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

Function getName

test/fixtures/snapshot/typescript.js:26888–26904  ·  view source on GitHub ↗
(node, allowComments, allowSourceMaps, emitFlags)

Source from the content-addressed store, hash-verified

26886 : ts.reduceLeft(expressions, factory.createComma);
26887 }
26888 function getName(node, allowComments, allowSourceMaps, emitFlags) {
26889 if (emitFlags === void 0) { emitFlags = 0; }
26890 var nodeName = ts.getNameOfDeclaration(node);
26891 if (nodeName && ts.isIdentifier(nodeName) && !ts.isGeneratedIdentifier(nodeName)) {
26892 // TODO(rbuckton): Does this need to be parented?
26893 var name = ts.setParent(ts.setTextRange(cloneNode(nodeName), nodeName), nodeName.parent);
26894 emitFlags |= ts.getEmitFlags(nodeName);
26895 if (!allowSourceMaps)
26896 emitFlags |= 48 /* EmitFlags.NoSourceMap */;
26897 if (!allowComments)
26898 emitFlags |= 1536 /* EmitFlags.NoComments */;
26899 if (emitFlags)
26900 ts.setEmitFlags(name, emitFlags);
26901 return name;
26902 }
26903 return getGeneratedNameForNode(node);
26904 }
26905 /**
26906 * Gets the internal name of a declaration. This is primarily used for declarations that can be
26907 * referred to by name in the body of an ES5 class function body. An internal name will *never*

Callers 6

getSpellingSuggestionFunction · 0.85
getInternalNameFunction · 0.85
getLocalNameFunction · 0.85
getExportNameFunction · 0.85
getDeclarationNameFunction · 0.85

Calls 2

cloneNodeFunction · 0.85
getGeneratedNameForNodeFunction · 0.85

Tested by

no test coverage detected