Whether a routine gives a value — a function or a constructor — rather than a procedure.
(routine: Node, context: ResolutionContext)
| 2788 | |
| 2789 | /** Whether a routine gives a value — a function or a constructor — rather than a procedure. */ |
| 2790 | function yieldsValue(routine: Node, context: ResolutionContext): boolean { |
| 2791 | if (routine.returnType) return true; |
| 2792 | const keyword = routineKeyword(routine, context); |
| 2793 | return keyword === 'function' || keyword === 'constructor'; |
| 2794 | } |
| 2795 | |
| 2796 | /** The keyword that declares a routine (`function`, `procedure`, `constructor`, …), lowercased, or null. */ |
| 2797 | function routineKeyword(routine: Node, context: ResolutionContext): string | null { |
no test coverage detected