MCPcopy
hub / github.com/webpack/webpack / inClassScope

Method inClassScope

lib/javascript/JavascriptParser.js:4613–4635  ·  view source on GitHub ↗

* Processes the provided has thi. * @param {boolean} hasThis true, when this is defined * @param {Identifier[]} params scope params * @param {() => void} fn inner function * @returns {void}

(hasThis, params, fn)

Source from the content-addressed store, hash-verified

4611 * @returns {void}
4612 */
4613 inClassScope(hasThis, params, fn) {
4614 const oldScope = this.scope;
4615 this.scope = {
4616 topLevelScope: oldScope.topLevelScope,
4617 inTry: false,
4618 inShorthand: false,
4619 inTaggedTemplateTag: false,
4620 isStrict: oldScope.isStrict,
4621 isAsmJs: oldScope.isAsmJs,
4622 terminated: undefined,
4623 definitions: oldScope.definitions.createChild()
4624 };
4625
4626 if (hasThis) {
4627 this.undefineVariable("this");
4628 }
4629
4630 this.enterPatterns(params, this._defineVariable);
4631
4632 fn();
4633
4634 this.scope = oldScope;
4635 }
4636
4637 /**
4638 * Processes the provided has thi.

Callers 1

walkClassMethod · 0.95

Calls 4

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

Tested by

no test coverage detected