Skip to content

fix: keep proxies opaque in util.inspect when showProxy is false - #61068

Closed
azadgupta1 wants to merge 1 commit into
nodejs:mainfrom
azadgupta1:fix-util-inspect-proxy-opaque
Closed

fix: keep proxies opaque in util.inspect when showProxy is false#61068
azadgupta1 wants to merge 1 commit into
nodejs:mainfrom
azadgupta1:fix-util-inspect-proxy-opaque

Conversation

@azadgupta1

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

codecovBot commented Dec 15, 2025

Copy link
Copy Markdown

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 linesCoverage Δ
lib/internal/util/inspect.js99.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
Copy Markdown
Member

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

@BridgeARBridgeAR left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
Member

Closing in favor of #61077

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

Labels

needs-ciPRs that need a full CI run.utilIssues and PRs related to the built-in util module.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@azadgupta1@benjamingr@BridgeAR@nodejs-github-bot