deno
6d575f35 - fix(watch): keep watcher alive when script calls Deno.exit()

Commit
100 days ago
fix(watch): keep watcher alive when script calls Deno.exit() When a script run with `deno run --watch` (or `deno serve --watch`) called `Deno.exit()`, the op went straight to `std::process::exit()`, killing the whole watcher process instead of just ending the current run. Mirror the approach the test runner already uses for `Deno.exit()` inside a test: when a watcher is active, `run_for_watcher` installs the isolate handle in `OpState` so `op_exit` terminates the current V8 isolate instead of the process. The watcher then clears the termination flag and treats it as a normal end of run, restarting on the next file change. Closes #7590
Author
Parents
Loading