deno
b9434ee3 - fix(repl): surface CDP protocol errors and fix race in wait_for_response (#33190)

Commit
97 days ago
fix(repl): surface CDP protocol errors and fix race in wait_for_response (#33190) ## Summary - The REPL's `wait_for_response` silently swallowed CDP error responses (responses with an `"error"` field instead of `"result"`), converting them to `null`. This made the `npm_packages` test failure on Windows ARM64 impossible to diagnose — the actual V8 error was lost and replaced by a confusing serde message (`invalid type: null, expected struct EvaluateResponse`). - Log CDP protocol errors via `eprintln!` so they appear in test stderr output on the next CI failure - Fix TOCTOU race: hold the lock across both the "check if ready" and "register WaitingFor" steps in `wait_for_response` to prevent a response from being overwritten between the two operations - Apply the same fixes to the duplicated code in `hmr.rs` ## Motivation The `integration::repl::npm_packages` test has become nearly constantly failing on Windows ARM64 CI ([example](https://github.com/denoland/deno/actions/runs/24003416554/job/70004374515)). The error output is: ``` "undefined\nerror: invalid type: null, expected struct EvaluateResponse\n" does not contain any of ["hello"] ``` This means V8's `Runtime.evaluate` returned a CDP protocol error, but the actual error message was discarded. With this change, the next CI failure will print the real V8 error to stderr, allowing us to identify and fix the root cause. --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Author
Parents
Loading