fix(fetch): support Headers init and iteration#3464
Merged
proggeramlug merged 6 commits intoMay 31, 2026
Merged
Conversation
This was referenced May 30, 2026
Contributor
Author
|
Updated this branch for the current mainline.
|
added 4 commits
May 31, 2026 08:48
# Conflicts: # crates/perry-hir/src/lower/expr_member.rs # crates/perry-runtime/src/symbol.rs # crates/perry-stdlib/src/fetch/dispatch.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3440
Fixes #2645
Summary
new Headers(init)for records, arrays/sequences, Maps/custom sync iterables, and existingHeadersclones.TypeErrorfornullinit or malformed constructor pairs.Headersmethod reads callable and stable enough for collection usage, withSymbol.iterator/@@iteratoraliasingentriesso spread,Array.from, andfor...ofwork.Why batched
Both issues target the same Headers collection semantics surface. Constructor materialization, iterator lookup, and runtime method dispatch share the same code paths, so fixing them together avoids splitting one behavior change across multiple PRs.
Tests
cargo fmt --allcargo check -p perry-runtime -p perry-stdlib -p perry-codegen -p perryPERRY_NO_AUTO_OPTIMIZE=1 ./run_parity_tests.sh --suite node-suite --module fetch --filter headersPERRY_NO_AUTO_OPTIMIZE=1 CARGO_TARGET_DIR=/tmp/perry-headers-target cargo build --release -p perry -p perry-runtime -p perry-stdlib/tmp/perry-headers-target/release/perry:test-parity/node-suite/fetch/headers/append-combines.tstest-parity/node-suite/fetch/headers/constructor-init.tstest-parity/node-suite/fetch/headers/get-set-cookie.tstest-parity/node-suite/fetch/headers/iterable-symbol.tscargo fmt --all -- --checkgit diff --check./scripts/check_file_size.shNon-goals