Describe the bug
new Request() silently accepts any value for the window option instead of throwing a TypeError. the Fetch Standard says window must be null - anything else should throw.
To Reproduce
new Request("https://example.com", { window: 1 })
// no error in Boa, expected TypeError
new Request("https://example.com", { window: "test" })
// no error in Boa, expected TypeError
From repo root:
cargo run --bin boa -- -e 'try { new Request("https://example.com", { window: 1 }); console.log("OK"); } catch (e) { console.log(e.name + ": " + e.message); }'
Boa output:
Node.js output:
node -e 'try { new Request("https://example.com", { window: 1 }); console.log("OK"); } catch (e) { console.log(e.name + ": " + e.message); }'
# TypeError: 'window' option 'client' must be null
Expected behavior
new Request() should throw a TypeError when window is any non-null value. window: null and omitting window should still work fine.
Build environment:
- OS: Windows 11
- Version: 10.0.26200
- Target triple: x86_64-pc-windows-msvc
- Rustc version: rustc 1.94.0 (4a4ef493e 2026-03-02)
Additional context
Root cause is in core/runtime/src/fetch/request.rs - RequestInit has no window field so any value passed is silently ignored.
Spec reference: https://fetch.spec.whatwg.org/#dom-request
Describe the bug
new Request()silently accepts any value for thewindowoption instead of throwing aTypeError. the Fetch Standard sayswindowmust benull- anything else should throw.To Reproduce
From repo root:
cargo run --bin boa -- -e 'try { new Request("https://example.com", { window: 1 }); console.log("OK"); } catch (e) { console.log(e.name + ": " + e.message); }'Boa output:
Node.js output:
Expected behavior
new Request()should throw aTypeErrorwhenwindowis any non-null value.window: nulland omittingwindowshould still work fine.Build environment:
Additional context
Root cause is in
core/runtime/src/fetch/request.rs-RequestInithas nowindowfield so any value passed is silently ignored.Spec reference: https://fetch.spec.whatwg.org/#dom-request