( binding: Binding, module: SourceModule )
| 3580 | } |
| 3581 | |
| 3582 | const staticProblemOf = ( |
| 3583 | binding: Binding, |
| 3584 | module: SourceModule |
| 3585 | ): string | undefined => |
| 3586 | binding.kind === "catch" ? "is a caught error" |
| 3587 | : binding.kind === "member" || binding.kind === "namespace" ? |
| 3588 | "is declared in a TypeScript namespace or enum" |
| 3589 | : binding.isAmbient ? "is declared without a value" |
| 3590 | : binding.writes.length ? |
| 3591 | `is ${module.scopes.bindingsById.has(binding.writes[0]) ? "declared again" : "assigned"} at ${module.positionOf(binding.writes[0])}, so its value at the site is not known` |
| 3592 | : isLoopVariable(binding) ? "is a loop variable" |
| 3593 | : binding.kind === "var" && !isDeclaredInBody(binding) ? |
| 3594 | "is a `var` declared in a nested statement, which may not run" |
| 3595 | : undefined |
| 3596 | |
| 3597 | // e.g. not in a function or loop, which may run it again after a later write |
| 3598 | const runsOnceIn = (node: Node, scope: Node): boolean => { |
no test coverage detected