Skip to content

Fix/headers iterable #4611#4638

Merged
jedel1043 merged 8 commits intoboa-dev:mainfrom
Rahul-2k4:fix/headers-iterable-4611
Feb 27, 2026
Merged

Fix/headers iterable #4611#4638
jedel1043 merged 8 commits intoboa-dev:mainfrom
Rahul-2k4:fix/headers-iterable-4611

Conversation

@Rahul-2k4
Copy link
Contributor

@Rahul-2k4 Rahul-2k4 commented Feb 20, 2026

Summary

This PR makes Headers iterable in Boa runtime so it can be consumed by iterable APIs.

This Pull Request closes #4611

What changed

  • Added a regression test for Headers iterability:
    • spread: [...new Headers([["x", "y"]])]
    • Map construction: new Map(new Headers([["x", "y"]]))
  • Wired Headers.prototype[Symbol.iterator] during fetch registration.
  • Exposed entries, keys, and values as class methods on Headers.

Why

Headers should be iterable over [name, value] pairs. Without @@iterator, spread and
Map construction throw a TypeError.

Testing

cargo test -p boa_runtime fetch::tests -- --nocapture

All fetch tests pass, including the new regression test.

@Rahul-2k4 Rahul-2k4 changed the title Fix/headers iterable 4611 Fix/headers iterable #4611 Feb 20, 2026
@github-actions
Copy link

github-actions bot commented Feb 20, 2026

Test262 conformance changes

Test result main count PR count difference
Total 52,862 52,862 0
Passed 49,504 49,504 0
Ignored 2,262 2,262 0
Failed 1,096 1,096 0
Panics 0 0 0
Conformance 93.65% 93.65% 0.00%

Copy link
Member

@jedel1043 jedel1043 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks almost perfect!

@Rahul-2k4 Rahul-2k4 force-pushed the fix/headers-iterable-4611 branch from 9848a6e to 2e1480c Compare February 20, 2026 19:15
@jedel1043
Copy link
Member

If you're using AI agents to do this work, maybe you should use something like git-worktree to avoid accidentally pushing unrelated commits? Just a suggestion.

@Rahul-2k4
Copy link
Contributor Author

Rahul-2k4 commented Feb 20, 2026

yep sure @jedel1043 ill keep that in mind . i got little confused because of some uncommited changes of my other pr . and again thank you for the suggestion of worktree that it will keep my workspace clean . Will keep in mind and ill surely improve from next time and thanks for the quick reviews

@codecov
Copy link

codecov bot commented Feb 20, 2026

Codecov Report

❌ Patch coverage is 93.10345% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 57.23%. Comparing base (6ddc2b4) to head (49b5a13).
⚠️ Report is 691 commits behind head on main.

Files with missing lines Patch % Lines
core/runtime/src/fetch/mod.rs 92.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4638      +/-   ##
==========================================
+ Coverage   47.24%   57.23%   +9.99%     
==========================================
  Files         476      550      +74     
  Lines       46892    60428   +13536     
==========================================
+ Hits        22154    34587   +12433     
- Misses      24738    25841    +1103     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jedel1043 jedel1043 added bug Something isn't working builtins PRs and Issues related to builtins/intrinsics runtime Issues and PRs related to Boa's runtime features and removed builtins PRs and Issues related to builtins/intrinsics labels Feb 25, 2026
@jedel1043 jedel1043 added the waiting-on-author Waiting on PR changes from the author label Feb 25, 2026
@Rahul-2k4 Rahul-2k4 force-pushed the fix/headers-iterable-4611 branch from cd41627 to ca51b07 Compare February 25, 2026 05:52
@Rahul-2k4 Rahul-2k4 force-pushed the fix/headers-iterable-4611 branch from ca51b07 to b286eec Compare February 25, 2026 06:03
Copy link
Member

@jedel1043 jedel1043 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! We'll hopefully remove all the boilerplate of setting up the method symbol when #4697 gets merged.

@Rahul-2k4
Copy link
Contributor Author

@jedel1043 yep sure

@Rahul-2k4 Rahul-2k4 requested a review from a team as a code owner February 26, 2026 09:23
Copy link
Member

@jedel1043 jedel1043 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, looks good!

@jedel1043 jedel1043 enabled auto-merge February 27, 2026 17:55
@jedel1043 jedel1043 added this pull request to the merge queue Feb 27, 2026
@jedel1043 jedel1043 removed the waiting-on-author Waiting on PR changes from the author label Feb 27, 2026
Merged via the queue into boa-dev:main with commit 88ba55b Feb 27, 2026
18 checks passed
@Rahul-2k4 Rahul-2k4 deleted the fix/headers-iterable-4611 branch February 27, 2026 19:58
akash-R-A-J pushed a commit to akash-R-A-J/boa that referenced this pull request Mar 1, 2026
## Summary

This PR makes `Headers` iterable in Boa runtime so it can be consumed by
iterable APIs.

This Pull Request closes boa-dev#4611 

  ### What changed

  - Added a regression test for `Headers` iterability:
    - spread: `[...new Headers([["x", "y"]])]`
    - `Map` construction: `new Map(new Headers([["x", "y"]]))`
- Wired `Headers.prototype[Symbol.iterator]` during fetch registration.
- Exposed `entries`, `keys`, and `values` as class methods on `Headers`.

  ### Why

`Headers` should be iterable over `[name, value]` pairs. Without
`@@iterator`, spread and
  `Map` construction throw a `TypeError`.

  ## Testing

  ```bash
  cargo test -p boa_runtime fetch::tests -- --nocapture

  All fetch tests pass, including the new regression test.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working runtime Issues and PRs related to Boa's runtime features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Headers should be iterable

2 participants