Skip to content

util: use primordials consistently in comparisons.js - #61198

Merged
aduh95 merged 1 commit into
nodejs:mainfrom
Ayoub-Mabrouk:util-use-primordials-comparisons
Aug 17, 2026
Merged

util: use primordials consistently in comparisons.js#61198
aduh95 merged 1 commit into
nodejs:mainfrom
Ayoub-Mabrouk:util-use-primordials-comparisons

Conversation

@Ayoub-Mabrouk

Copy link
Copy Markdown
Contributor

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

codecov Bot commented Dec 29, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.55%. Comparing base (05d6b9b) to head (2413d7a).
⚠️ Report is 454 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 outstanding review comments, 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

This comment was marked as outdated.

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@trivikr

trivikr commented Jun 22, 2026

Copy link
Copy Markdown
Member

The benchmarks can be run with CATEGORY=assert and FILTER=deepequal once the CI is fixed in nodejs/build#4374

@aduh95
aduh95 merged commit cc60845 into nodejs:main Aug 17, 2026
66 checks passed
@aduh95

aduh95 commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Landed in cc60845

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 outstanding review comments, 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.

7 participants