(
node: Extract<Node, { type: "VariableDeclaration" }>
)
| 412 | } |
| 413 | |
| 414 | private visitVariables( |
| 415 | node: Extract<Node, { type: "VariableDeclaration" }> |
| 416 | ): void { |
| 417 | const kind: BindingKind = |
| 418 | node.kind === "var" ? "var" |
| 419 | : node.kind === "let" ? "let" |
| 420 | : "const" |
| 421 | for (const declarator of node.declarations) { |
| 422 | declarator.parent = node |
| 423 | const scope = kind === "var" ? this.functionScope() : this.scope |
| 424 | if ( |
| 425 | declarator.init && |
| 426 | declarator.id.type === "Identifier" && |
| 427 | scope.bindings[declarator.id.name]?.kind === "var" |
| 428 | ) { |
| 429 | scope.bindings[declarator.id.name].writes.push(declarator.id) |
| 430 | declarator.id.parent = declarator |
| 431 | } else |
| 432 | this.bindPattern(declarator.id, kind, declarator, declarator, scope) |
| 433 | if (node.declare) { |
| 434 | for (const id of idsOf(declarator.id)) |
| 435 | this.bindingsById.get(id)!.isAmbient = true |
| 436 | } |
| 437 | this.visit(declarator.init, declarator) |
| 438 | } |
| 439 | } |
| 440 | |
| 441 | private visitExport( |
| 442 | node: Extract<Node, { type: "ExportNamedDeclaration" }> |
no test coverage detected