MCPcopy
hub / github.com/webpack/webpack / inScope

Method inScope

lib/javascript/JavascriptParser.js:4584–4604  ·  view source on GitHub ↗

* Processes the provided param. * @deprecated * @param {(string | Pattern | Property)[]} params scope params * @param {() => void} fn inner function * @returns {void}

(params, fn)

Source from the content-addressed store, hash-verified

4582 * @returns {void}
4583 */
4584 inScope(params, fn) {
4585 const oldScope = this.scope;
4586 this.scope = {
4587 topLevelScope: oldScope.topLevelScope,
4588 inTry: false,
4589 inShorthand: false,
4590 inTaggedTemplateTag: false,
4591 isStrict: oldScope.isStrict,
4592 isAsmJs: oldScope.isAsmJs,
4593 terminated: undefined,
4594 definitions: oldScope.definitions.createChild()
4595 };
4596
4597 this.undefineVariable("this");
4598
4599 this.enterPatterns(params, this._defineVariable);
4600
4601 fn();
4602
4603 this.scope = oldScope;
4604 }
4605
4606 /**
4607 * Processes the provided has thi.

Callers

nothing calls this directly

Calls 4

undefineVariableMethod · 0.95
enterPatternsMethod · 0.95
createChildMethod · 0.80
fnFunction · 0.50

Tested by

no test coverage detected