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

Function copySymbol

test/fixtures/snapshot/typescript.js:86129–86139  ·  view source on GitHub ↗

* Copy the given symbol into symbol tables if the symbol has the given meaning * and it doesn't already existed in the symbol table * @param key a key for storing in symbol table; if undefined, use symbol.name * @param symbol the symbol to be added into symbol

(symbol, meaning)

Source from the content-addressed store, hash-verified

86127 * @param meaning meaning of symbol to filter by before adding to symbol table
86128 */
86129 function copySymbol(symbol, meaning) {
86130 if (ts.getCombinedLocalAndExportSymbolFlags(symbol) & meaning) {
86131 var id = symbol.escapedName;
86132 // We will copy all symbol regardless of its reserved name because
86133 // symbolsToArray will check whether the key is a reserved name and
86134 // it will not copy symbol with reserved name to the array
86135 if (!symbols.has(id)) {
86136 symbols.set(id, symbol);
86137 }
86138 }
86139 }
86140 function copySymbols(source, meaning) {
86141 if (meaning) {
86142 source.forEach(function (symbol) {

Callers 3

populateSymbolsFunction · 0.85
copySymbolsFunction · 0.85

Calls 2

hasMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected