merge: PR #1032 — fix TDZ crash when probe spawn throws synchronously

This commit is contained in:
Menghuan1918 committed 2026-10-29 23:28:13 +08:00
commit fbc7e4cd1b
2 files changed
+24 -3

No files matched your search

+2 -1
View File
@@ -179,6 +179,7 @@ function candidates(engine: Engine): string[] {
function verify(binary: string): Promise<boolean> {
return new Promise((resolve) => {
let settled = false
let timer: ReturnType<typeof setTimeout> | undefined = undefined
const finish = (ok: boolean): void => {
if (settled) return
settled = true
@@ -192,7 +193,7 @@ function verify(binary: string): Promise<boolean> {
finish(false)
return
}
const timer = setTimeout(() => {
timer = setTimeout(() => {
child.kill()
finish(false)
}, PROBE_TIMEOUT_MS)