Skip to content

util: use primordials consistently in comparisons.js#61198

Open
Ayoub-Mabrouk wants to merge 1 commit intonodejs:mainfrom
Ayoub-Mabrouk:util-use-primordials-comparisons
Open

util: use primordials consistently in comparisons.js#61198
Ayoub-Mabrouk wants to merge 1 commit intonodejs:mainfrom
Ayoub-Mabrouk:util-use-primordials-comparisons

Conversation

@Ayoub-Mabrouk
Copy link

Replace native array.push() with ArrayPrototypePush in lib/internal/util/comparisons.js for consistency and security.

This improves protection against prototype pollution and aligns with the primordials pattern used throughout the codebase.

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. util Issues and PRs related to the built-in util module. labels Dec 29, 2025
@codecov
Copy link

codecov bot commented Dec 29, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.55%. Comparing base (05d6b9b) to head (2413d7a).
⚠️ Report is 368 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #61198      +/-   ##
==========================================
+ Coverage   88.53%   88.55%   +0.01%     
==========================================
  Files         703      703              
  Lines      208599   208613      +14     
  Branches    40229    40243      +14     
==========================================
+ Hits       184685   184728      +43     
+ Misses      15939    15894      -45     
- Partials     7975     7991      +16     
Files with missing lines Coverage Δ
lib/internal/util/comparisons.js 99.71% <100.00%> (+<0.01%) ⬆️

... and 31 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.

@avivkeller avivkeller added the needs-benchmark-ci PR that need a benchmark CI run. label Dec 29, 2025
@Ayoub-Mabrouk Ayoub-Mabrouk force-pushed the util-use-primordials-comparisons branch from 9b5d7b1 to 10b4d8d Compare December 29, 2025 16:46
Replace native methods with primordials.
@Ayoub-Mabrouk Ayoub-Mabrouk force-pushed the util-use-primordials-comparisons branch from 10b4d8d to 2413d7a Compare December 29, 2025 17:47
@aduh95 aduh95 added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Feb 17, 2026
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Feb 18, 2026
@nodejs-github-bot
Copy link
Collaborator

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

Labels

author ready PRs that have at least one approval, no pending requests for changes, and a CI started. needs-benchmark-ci PR that need a benchmark CI run. needs-ci PRs that need a full CI run. util Issues and PRs related to the built-in util module.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

Comments