()
| 147 | let assertingUnchecked = false |
| 148 | |
| 149 | export const assertUnchecked = (): void => { |
| 150 | // an assertion can resolve an alias, which asserts again, so what it queues |
| 151 | // runs in the outer loop |
| 152 | if (!isResolutionFinal() || assertingUnchecked) return |
| 153 | assertingUnchecked = true |
| 154 | let passed = false |
| 155 | let i = 0 |
| 156 | try { |
| 157 | for (; i < uncheckedAssertions.length; i++) uncheckedAssertions[i]() |
| 158 | passed = true |
| 159 | } catch (e) { |
| 160 | for (const [fail, from, to, unrun] of uncheckedOwners) { |
| 161 | if (from <= i && i < to) fail(e) |
| 162 | // those up to i passed, so one whose checks all came before it did too |
| 163 | else if (i < from && from < to) unrun() |
| 164 | } |
| 165 | uncheckedOwners.length = 0 |
| 166 | throw e |
| 167 | } finally { |
| 168 | assertingUnchecked = false |
| 169 | discardUnchecked(passed) |
| 170 | } |
| 171 | } |
| 172 | |
| 173 | let discards = 0 |
| 174 |
no test coverage detected