MCPcopy
hub / github.com/webpack/webpack / addVariableUsage

Function addVariableUsage

lib/optimize/InnerGraph.js:246–254  ·  view source on GitHub ↗

* @param {JavascriptParser} parser the parser * @param {string} name name of variable * @param {Usage} usage usage data * @returns {void}

(parser, name, usage)

Source from the content-addressed store, hash-verified

244 * @returns {void}
245 */
246 function addVariableUsage(parser, name, usage) {
247 const symbol =
248 /** @type {TopLevelSymbol} */ (
249 parser.getTagData(name, topLevelSymbolTag)
250 ) || tagTopLevelSymbol(parser, name);
251 if (symbol) {
252 addUsage(parser.state, symbol, usage);
253 }
254 }
255
256 /**
257 * @param {ParserState} state parser state

Callers

nothing calls this directly

Calls 3

tagTopLevelSymbolFunction · 0.85
addUsageFunction · 0.85
getTagDataMethod · 0.80

Tested by

no test coverage detected