Skip to content

Conversation

@Ayoub-Mabrouk
Copy link

Replace native array methods (.push, .pop, .splice, .slice) withprimordials (ArrayPrototypePush, ArrayPrototypePop, ArrayPrototypeSplice,ArrayPrototypeSlice) throughout lib/internal/util/inspect.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.03%. Comparing base (05d6b9b) to head (2e8ff01).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #61196      +/-   ##
==========================================
- Coverage   88.53%   88.03%   -0.51%     
==========================================
  Files         703      703              
  Lines      208599   208613      +14     
  Branches    40229    40157      -72     
==========================================
- Hits       184685   183645    -1040     
- Misses      15939    16927     +988     
- Partials     7975     8041      +66     
Files with missing lines Coverage Δ
lib/internal/util/inspect.js 98.75% <100.00%> (-0.89%) ⬇️

... and 100 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
@avivkeller
Copy link
Member

Please amend your commit to abide by the comment guidelines

@Ayoub-Mabrouk Ayoub-Mabrouk force-pushed the util-use-primordials-inspect branch from 2a3009f to b59f8d7 Compare December 29, 2025 16:46
Replace native methods with primordials.
@Ayoub-Mabrouk Ayoub-Mabrouk force-pushed the util-use-primordials-inspect branch from b59f8d7 to 2e8ff01 Compare December 29, 2025 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

4 participants