Whether a routine has a parameter without a default value, which a call must pass.
(routine: Node)
| 1236 | |
| 1237 | /** Whether a routine has a parameter without a default value, which a call must pass. */ |
| 1238 | function needsArguments(routine: Node): boolean { |
| 1239 | const signature = routine.signature?.trim(); |
| 1240 | if (!signature?.startsWith('(')) return false; |
| 1241 | let depth = 0; |
| 1242 | let end = signature.length; |
| 1243 | for (let i = 0; i < signature.length; i++) { |
| 1244 | if (signature[i] === '(') depth++; |
| 1245 | else if (signature[i] === ')' && --depth === 0) { |
| 1246 | end = i; |
| 1247 | break; |
| 1248 | } |
| 1249 | } |
| 1250 | return signature.slice(1, end).split(';').some((param) => param.trim() !== '' && !param.includes('=')); |
| 1251 | } |
| 1252 | |
| 1253 | /** Whether a routine gives a value — a function or a constructor — rather than a procedure. */ |
| 1254 | function yieldsValue(routine: Node, context: ResolutionContext): boolean { |
no outgoing calls
no test coverage detected