fix(fetch): reject non-null window option in Request constructor#5210
fix(fetch): reject non-null window option in Request constructor#5210HiteshShonak wants to merge 2 commits intoboa-dev:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates Boa’s Fetch Request implementation to align with the Fetch Standard requirement that the window option must be null, and adds a regression test to ensure non-null values throw.
Changes:
- Extend
RequestInitwith awindowfield and throw aTypeErrorwhenwindowis non-null. - Add a regression test that checks several non-null
windowvalues throw, whilenullis accepted.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| core/runtime/src/fetch/request.rs | Adds window to RequestInit and validates it during request construction. |
| core/runtime/src/fetch/tests/request.rs | Adds a regression test for Request constructor window option behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Test262 conformance changes
Tested main commit: |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5210 +/- ##
===========================================
+ Coverage 47.24% 59.81% +12.56%
===========================================
Files 476 582 +106
Lines 46892 63463 +16571
===========================================
+ Hits 22154 37958 +15804
- Misses 24738 25505 +767 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This Pull Request fixes/closes #5209.
It changes the following:
windowfield toRequestInitand reject any non-null value with aTypeError.nullis still accepted.Testing:
cargo test -p boa_runtime request -- --nocaptureSpec reference: https://fetch.spec.whatwg.org/#dom-request