Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Headers): forEach #1425

Merged
merged 2 commits into from May 9, 2022
Merged

fix(Headers): forEach #1425

merged 2 commits into from May 9, 2022

Conversation

KhafraDev
Copy link
Member

@KhafraDev KhafraDev commented May 9, 2022

Headers.forEach had a bunch of things wrong with it:

  • Parameter order was named weird (where key was named as index in the code).
  • thisArg was not set to globalThis by default.
  • Headers.prototype.forEach.length was returning 0, instead of 1 (this is another issue I was going to make a PR for eventually).

I have 2 more PRs planned for Headers fixes, so I'm wondering if you would prefer combining those 2 changes into a single PR, or if you would prefer 2 separate PRs?

@codecov-commenter
Copy link

Codecov Report

Merging #1425 (2479b18) into main (55d72ac) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #1425      +/-   ##
==========================================
- Coverage   94.27%   94.27%   -0.01%     
==========================================
  Files          49       49              
  Lines        4248     4244       -4     
==========================================
- Hits         4005     4001       -4     
  Misses        243      243              
Impacted Files Coverage Δ
lib/fetch/headers.js 93.24% <100.00%> (-0.18%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 55d72ac...2479b18. Read the comment docs.

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@mcollina
Copy link
Member

mcollina commented May 9, 2022

go for them separately!

@mcollina mcollina merged commit e7f051f into nodejs:main May 9, 2022
@KhafraDev KhafraDev deleted the headers-foreach branch May 9, 2022 21:58
KhafraDev added a commit to KhafraDev/undici that referenced this pull request Jun 23, 2022
metcoder95 pushed a commit to metcoder95/undici that referenced this pull request Dec 26, 2022
crysmags pushed a commit to crysmags/undici that referenced this pull request Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants