* Walk function expression. * @param {FunctionExpression} expression arrow function expression
(expression)
| 3692 | * @param {FunctionExpression} expression arrow function expression |
| 3693 | */ |
| 3694 | walkFunctionExpression(expression) { |
| 3695 | const wasTopLevel = this.scope.topLevelScope; |
| 3696 | this.scope.topLevelScope = false; |
| 3697 | // Only copy params when the function name must be added (recursive calls); |
| 3698 | // inFunctionScope reads params without mutating, like arrow functions. |
| 3699 | const scopeParams = expression.id |
| 3700 | ? [...expression.params, expression.id] |
| 3701 | : expression.params; |
| 3702 | |
| 3703 | this.inFunctionScope(true, scopeParams, () => { |
| 3704 | for (const param of expression.params) { |
| 3705 | this.walkPattern(param); |
| 3706 | } |
| 3707 | |
| 3708 | this.detectMode(expression.body.body); |
| 3709 | |
| 3710 | const prev = this.prevStatement; |
| 3711 | |
| 3712 | this.preWalkStatement(expression.body); |
| 3713 | this.prevStatement = prev; |
| 3714 | this.walkStatement(expression.body); |
| 3715 | }); |
| 3716 | this.scope.topLevelScope = wasTopLevel; |
| 3717 | } |
| 3718 | |
| 3719 | /** |
| 3720 | * Walk arrow function expression. |
no test coverage detected