Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Closed
azadgupta1 wants to merge 1 commit into
nodejs:mainnodejs/node:mainfrom
azadgupta1:fix-util-inspect-proxy-opaqueazadgupta1/node:fix-util-inspect-proxy-opaqueCopy head branch name to clipboard
Closed

fix: keep proxies opaque in util.inspect when showProxy is false#61068
azadgupta1 wants to merge 1 commit into
nodejs:mainnodejs/node:mainfrom
azadgupta1:fix-util-inspect-proxy-opaqueazadgupta1/node:fix-util-inspect-proxy-opaqueCopy head branch name to clipboard

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-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

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

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

@BridgeAR BridgeAR 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

@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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.