Skip to content

Commit 4b45951

Browse files
committed
fix: keep proxies opaque in util.inspect when showProxy is false
1 parent 444e81f commit 4b45951

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/internal/util/inspect.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1125,10 +1125,14 @@ function formatValue(ctx, value, recurseTimes, typedArray) {
11251125
if (proxy === null || proxy[0] === null) {
11261126
return ctx.stylize('<Revoked Proxy>', 'special');
11271127
}
1128+
11281129
if (ctx.showProxy) {
11291130
return formatProxy(ctx, proxy, recurseTimes);
11301131
}
1131-
value = proxy;
1132+
1133+
// Treat proxies as opaque when showProxy is false,
1134+
// but preserve the original target for inspection.
1135+
value = proxy[0];
11321136
}
11331137

11341138
// Provide a hook for user-specified inspect functions.

0 commit comments

Comments
 (0)