fix(app-boot): drop the unreachable timer guard on the fail-loud release path

The timeout promise's executor runs synchronously while the race is
constructed, so the timer is always assigned; the undefined check was a
dead branch the per-file coverage gate rejected.
This commit is contained in:
Turtle
2026-07-31 22:14:43 +08:00
parent 998f9c931d
commit 54e541d33f
1 file changed
+4 -2
+4 -2
View File
@@ -384,7 +384,9 @@ export function installFailLoud(
return
}
void (async () => {
let timer: ReturnType<typeof setTimeout> | undefined
// Definitely assigned: the timeout promise's executor runs synchronously
// while the race is being constructed, before the first await.
let timer!: ReturnType<typeof setTimeout>
try {
await Promise.race([
(async () => release())(),
@@ -396,7 +398,7 @@ export function installFailLoud(
// The terminal release failed; the fatal exit below is the outcome that
// matters, and no reporter runs after it.
}
if (timer !== undefined) clearTimeout(timer)
clearTimeout(timer)
proc.exit(1)
})()
}