(node: estree.Node, isBlockDeclaration: boolean, isVar: boolean)
| 42 | } |
| 43 | |
| 44 | addDeclaration(node: estree.Node, isBlockDeclaration: boolean, isVar: boolean): void { |
| 45 | if (!isBlockDeclaration && this.isBlockScope) { |
| 46 | // it's a `var` or function node, and this |
| 47 | // is a block scope, so we need to go up |
| 48 | this.parent!.addDeclaration(node, isBlockDeclaration, isVar); |
| 49 | } else if ((node as any).id) { |
| 50 | extractAssignedNames((node as any).id).forEach((name) => { |
| 51 | this.declarations[name] = true; |
| 52 | }); |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | contains(name: string): boolean { |
| 57 | return this.declarations[name] || (this.parent ? this.parent.contains(name) : false); |
nothing calls this directly
no test coverage detected