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

Function cloneSymbol

test/fixtures/snapshot/typescript.js:49121–49135  ·  view source on GitHub ↗
(symbol)

Source from the content-addressed store, hash-verified

49119 mergedSymbols[source.mergeId] = target;
49120 }
49121 function cloneSymbol(symbol) {
49122 var result = createSymbol(symbol.flags, symbol.escapedName);
49123 result.declarations = symbol.declarations ? symbol.declarations.slice() : [];
49124 result.parent = symbol.parent;
49125 if (symbol.valueDeclaration)
49126 result.valueDeclaration = symbol.valueDeclaration;
49127 if (symbol.constEnumOnlyModule)
49128 result.constEnumOnlyModule = true;
49129 if (symbol.members)
49130 result.members = new ts.Map(symbol.members);
49131 if (symbol.exports)
49132 result.exports = new ts.Map(symbol.exports);
49133 recordMergedSymbol(result, symbol);
49134 return result;
49135 }
49136 /**
49137 * Note: if target is transient, then it is mutable, and mergeSymbol with both mutate and return it.
49138 * If target is not transient, mergeSymbol will produce a transient clone, mutate that and return it.

Callers 3

mergeSymbolFunction · 0.85
getCommonJsExportEqualsFunction · 0.85
mergeJSSymbolsFunction · 0.85

Calls 3

createSymbolFunction · 0.85
recordMergedSymbolFunction · 0.85
sliceMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…