#51953: fix: only set Node's WASM streaming callback when fetch is enabled
Fixes #51950
Description of Change
Node.js v24.16.0 removed the experimental_fetch gate around isolate->SetWasmStreamingCallback() (nodejs/node#62759). When fix_allow_disabling_fetch_in_renderer_and_worker_processes.patch was rebased for the Node bump, the flag was restored but that gate was not.
As a result, Node.js unconditionally overrode Blink's WebAssembly streaming callback in renderer and worker processes — where we pass --no-experimental-fetch and never register Node's JS-side streaming implementation. Any WebAssembly.compileStreaming() / instantiateStreaming() call in a renderer with nodeIntegration: true then failed the CHECK(!impl.IsEmpty()) assertion in node_wasm_web_api.cc and crashed the renderer.
This restores the gate (matching the v24.15.0 behavior) so Blink's streaming callback stays installed in processes where Node's fetch is disabled, and adds a regression test. Browser, utility, and ELECTRON_RUN_AS_NODE processes are unaffected — fetch is enabled there, so Node's streaming implementation is still installed.
Checklist
- PR description included and stakeholders cc'd
-
npm testpasses - tests are added/changed
Release Notes
Notes: Fixed a renderer crash when calling WebAssembly.compileStreaming() or WebAssembly.instantiateStreaming() with nodeIntegration enabled.
Backports
Semver Impact
Semantic Versioning helps users understand the impact of updates:
- Major (X.y.z): Breaking changes that may require code modifications
- Minor (x.Y.z): New features that maintain backward compatibility
- Patch (x.y.Z): Bug fixes that don't change the API
- None: Changes that don't affect using facing parts of Electron