Skip to content

net: avoid mutable push in BlockList - #67886

Open
rozzilla wants to merge 1 commit into
nodejs:mainfrom
rozzilla:net-blocklist-no-push
Open

rozzilla wants to merge 1 commit into
nodejs:mainfrom
rozzilla:net-blocklist-no-push

Conversation

@rozzilla

@rozzilla rozzilla commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

BlockList.prototype.addAddresses() and addCIDRs() collected entries with .push() on local arrays. If user code replaced Array.prototype.push, these methods went through it. This uses indexed assignments instead.

Same approach as #67748, #67751 and #67752: local arrays only, no performance claim.

BlockList.prototype.addAddresses() and addCIDRs() collected entries with
.push() on local arrays, which looks up Array.prototype.push at call
time. Replacing that method from user code changed how these methods
ran. Use indexed assignments instead.

Signed-off-by: Roberto Bianchi <roberto.bianchi@spendesk.com>
@nodejs-github-bot nodejs-github-bot added the needs-ci PRs that need a full CI run. label Nov 30, 2026
@codecov

codecov Bot commented Nov 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.57%. Comparing base (1611823) to head (9555137).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #67886      +/-   ##
==========================================
- Coverage   90.58%   90.57%   -0.01%     
==========================================
  Files         802      802              
  Lines      286656   286656              
  Branches    55369    55366       -3     
==========================================
- Hits       259668   259645      -23     
- Misses      17089    17110      +21     
- Partials     9899     9901       +2     
Files with missing lines Coverage Δ
lib/internal/blocklist.js 97.20% <100.00%> (ø)

... and 29 files with indirect coverage changes

🚀 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants