Skip to content

Conversation

@Han5991
Copy link
Contributor

@Han5991 Han5991 commented Nov 19, 2025

util.inspect() was still inserting line breaks when both breakLength and depth were set to Infinity. Grouping logic and the compact
inline heuristics were ignoring the special “no wrapping” intent. This change adds an isUnlimitedDepth() guard so the line-wrapping paths
are skipped when the user explicitly asks for infinite width and depth.

Fixes: #60475

image

@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 Nov 19, 2025
@codecov
Copy link

codecov bot commented Nov 19, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.54%. Comparing base (0b6ae6d) to head (a3ba562).
⚠️ Report is 10 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #60783      +/-   ##
==========================================
+ Coverage   88.04%   88.54%   +0.50%     
==========================================
  Files         703      703              
  Lines      208260   208269       +9     
  Branches    40068    40169     +101     
==========================================
+ Hits       183360   184419    +1059     
+ Misses      16840    15884     -956     
+ Partials     8060     7966      -94     
Files with missing lines Coverage Δ
lib/internal/util/inspect.js 99.63% <100.00%> (+0.92%) ⬆️

... and 105 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. util Issues and PRs related to the built-in util module.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

util.inspect() ignores breakLength: Infinity when depth: Infinity is also set in some cases

2 participants