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

Function getNameCandidateWorker

test/fixtures/snapshot/typescript.js:55312–55328  ·  view source on GitHub ↗
(symbol, localName)

Source from the content-addressed store, hash-verified

55310 return input;
55311 }
55312 function getNameCandidateWorker(symbol, localName) {
55313 if (localName === "default" /* InternalSymbolName.Default */ || localName === "__class" /* InternalSymbolName.Class */ || localName === "__function" /* InternalSymbolName.Function */) {
55314 var flags = context.flags;
55315 context.flags |= 16777216 /* NodeBuilderFlags.InInitialEntityName */;
55316 var nameCandidate = getNameOfSymbolAsWritten(symbol, context);
55317 context.flags = flags;
55318 localName = nameCandidate.length > 0 && ts.isSingleOrDoubleQuote(nameCandidate.charCodeAt(0)) ? ts.stripQuotes(nameCandidate) : nameCandidate;
55319 }
55320 if (localName === "default" /* InternalSymbolName.Default */) {
55321 localName = "_default";
55322 }
55323 else if (localName === "export=" /* InternalSymbolName.ExportEquals */) {
55324 localName = "_exports";
55325 }
55326 localName = ts.isIdentifierText(localName, languageVersion) && !ts.isStringANonContextualKeyword(localName) ? localName : "_" + localName.replace(/[^a-zA-Z0-9]/g, "_");
55327 return localName;
55328 }
55329 function getInternalSymbolName(symbol, localName) {
55330 var id = getSymbolId(symbol);
55331 if (context.remappedSymbolNames.has(id)) {

Callers 2

getUnusedNameFunction · 0.85
getInternalSymbolNameFunction · 0.85

Calls 1

getNameOfSymbolAsWrittenFunction · 0.85

Tested by

no test coverage detected