* Processes the provided has thi. * @param {boolean} hasThis true, when this is defined * @param {(Pattern | string)[]} params scope params * @param {() => void} fn inner function * @returns {void}
(hasThis, params, fn)
| 4642 | * @returns {void} |
| 4643 | */ |
| 4644 | inFunctionScope(hasThis, params, fn) { |
| 4645 | const oldScope = this.scope; |
| 4646 | this.scope = { |
| 4647 | topLevelScope: oldScope.topLevelScope, |
| 4648 | inTry: false, |
| 4649 | inShorthand: false, |
| 4650 | inTaggedTemplateTag: false, |
| 4651 | isStrict: oldScope.isStrict, |
| 4652 | isAsmJs: oldScope.isAsmJs, |
| 4653 | terminated: undefined, |
| 4654 | definitions: oldScope.definitions.createChild() |
| 4655 | }; |
| 4656 | |
| 4657 | if (hasThis) { |
| 4658 | this.undefineVariable("this"); |
| 4659 | } |
| 4660 | |
| 4661 | this.enterPatterns(params, this._defineVariable); |
| 4662 | |
| 4663 | fn(); |
| 4664 | |
| 4665 | this.scope = oldScope; |
| 4666 | } |
| 4667 | |
| 4668 | /** |
| 4669 | * Processes the provided fn. |
no test coverage detected