MCPcopy
hub / github.com/webpack/webpack / defineVariable

Method defineVariable

lib/javascript/JavascriptParser.js:5493–5503  ·  view source on GitHub ↗

* Processes the provided name. * @param {string} name variable name

(name)

Source from the content-addressed store, hash-verified

5491 * @param {string} name variable name
5492 */
5493 defineVariable(name) {
5494 const oldInfo = this.scope.definitions.get(name);
5495 // Don't redefine variable in same scope to keep existing tags
5496 if (
5497 oldInfo instanceof VariableInfo &&
5498 oldInfo.declaredScope === this.scope
5499 ) {
5500 return;
5501 }
5502 this.scope.definitions.set(name, this.scope);
5503 }
5504
5505 /**
5506 * Processes the provided name.

Callers 9

constructorMethod · 0.95
walkCatchClauseMethod · 0.95
tagTopLevelSymbolFunction · 0.80
applyMethod · 0.80

Calls 2

getMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected