(define: () => t)
| 215 | |
| 216 | // a check left from a parse that threw would read its unresolved aliases |
| 217 | export const defining = <t>(define: () => t): t => { |
| 218 | if (isResolutionFinal()) discardUnchecked() |
| 219 | inProgress.definitions++ |
| 220 | let defined = false |
| 221 | try { |
| 222 | const result = define() |
| 223 | defined = true |
| 224 | return result |
| 225 | } finally { |
| 226 | inProgress.definitions-- |
| 227 | // nor is its error another Type's, which whatever resolves next would |
| 228 | // throw if the checks waited for the next definition to discard them |
| 229 | if (!defined && isResolutionFinal()) discardUnchecked() |
| 230 | } |
| 231 | } |
| 232 | |
| 233 | // a Type read while another node is built or described is nested in it |
| 234 | export const composing = <t>(compose: () => t): t => { |
no test coverage detected