Skip to content

Conversation

@azadgupta1
Copy link
Contributor

Currently, util.inspect unwraps proxies even when showProxy is false,
which can trigger traps for nested proxies and lead to unexpected errors.

This change:

  • Treats proxies as opaque when showProxy is false.
  • Keeps the original target for internal inspection.
  • Adds a regression test to ensure that accessing nested proxies does not throw when showProxy is disabled.

Refs: #61061

@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 15, 2025
@azadgupta1 azadgupta1 force-pushed the fix-util-inspect-proxy-opaque branch 2 times, most recently from 8e4666e to f9a0b52 Compare December 15, 2025 06:06
@azadgupta1 azadgupta1 force-pushed the fix-util-inspect-proxy-opaque branch from f9a0b52 to 35e258c Compare December 15, 2025 06:18
@codecov
Copy link

codecov bot commented Dec 15, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.42%. Comparing base (900d329) to head (35e258c).
⚠️ Report is 159 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #61068      +/-   ##
==========================================
- Coverage   88.55%   88.42%   -0.14%     
==========================================
  Files         703      703              
  Lines      208260   208550     +290     
  Branches    40155    40135      -20     
==========================================
- Hits       184430   184410      -20     
- Misses      15837    16148     +311     
+ Partials     7993     7992       -1     
Files with missing lines Coverage Δ
lib/internal/util/inspect.js 99.67% <100.00%> (+0.03%) ⬆️

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

@benjamingr
Copy link
Member

I think this is the opposite of what @jasnell wanted?

Copy link
Member

@BridgeAR BridgeAR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This actually does not fix the issue, while it fails many tests

@BridgeAR
Copy link
Member

Closing in favor of #61077

@BridgeAR BridgeAR closed this Dec 17, 2025
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.

4 participants