| 361 | } |
| 362 | |
| 363 | private visitFunction(node: Function | ArrowFunctionNode): void { |
| 364 | const { body } = node |
| 365 | if (!body) return |
| 366 | if (node.type === "FunctionDeclaration" && node.id) |
| 367 | this.bind(node.id, "function", node, node) |
| 368 | const visitScope = () => |
| 369 | this.inScope(node, () => { |
| 370 | for (const param of runtimeParamsOf(node)) |
| 371 | this.bindPattern(param, "param", node, node) |
| 372 | if (body.type === "BlockStatement") { |
| 373 | body.parent = node |
| 374 | this.visitAll(body.body, body) |
| 375 | } else this.visit(body, node) |
| 376 | }) |
| 377 | if (node.type === "FunctionExpression" && node.id) { |
| 378 | this.inScope(node, () => { |
| 379 | this.bind(node.id!, "function", node, node) |
| 380 | visitScope() |
| 381 | }) |
| 382 | } else visitScope() |
| 383 | } |
| 384 | |
| 385 | private visitClass(node: Class): void { |
| 386 | if (node.declare) return |