Whether a routine has a parameter without a default value, which a call must pass.
(routine: Node)
| 2772 | |
| 2773 | /** Whether a routine has a parameter without a default value, which a call must pass. */ |
| 2774 | function needsArguments(routine: Node): boolean { |
| 2775 | const signature = routine.signature?.trim(); |
| 2776 | if (!signature?.startsWith('(')) return false; |
| 2777 | let depth = 0; |
| 2778 | let end = signature.length; |
| 2779 | for (let i = 0; i < signature.length; i++) { |
| 2780 | if (signature[i] === '(') depth++; |
| 2781 | else if (signature[i] === ')' && --depth === 0) { |
| 2782 | end = i; |
| 2783 | break; |
| 2784 | } |
| 2785 | } |
| 2786 | return signature.slice(1, end).split(';').some((param) => param.trim() !== '' && !param.includes('=')); |
| 2787 | } |
| 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 { |
no outgoing calls
no test coverage detected