diff --git a/lib/internal/util/inspect.js b/lib/internal/util/inspect.js index ebb43204d052fa..3a6be23eb508b6 100644 --- a/lib/internal/util/inspect.js +++ b/lib/internal/util/inspect.js @@ -520,17 +520,12 @@ function formatValue(ctx, value, recurseTimes, typedArray) { // any proxy handlers. const proxy = getProxyDetails(value); if (proxy !== undefined) { - if (ctx.showProxy && ctx.stop === undefined) { + if (ctx.showProxy) { return formatProxy(ctx, proxy, recurseTimes); } value = proxy[0]; } - if (ctx.stop !== undefined) { - const name = getConstructorName(value, ctx) || value[Symbol.toStringTag]; - return ctx.stylize(`[${name || 'Object'}]`, 'special'); - } - // Provide a hook for user-specified inspect functions. // Check that value is an object with an inspect function on it. if (ctx.customInspect) { @@ -788,7 +783,7 @@ function formatRaw(ctx, value, recurseTimes, typedArray) { // This limit also makes sure that huge objects don't block the event loop // significantly. if (newLength > 2 ** 27) { - ctx.stop = true; + ctx.depth = -1; } return res; }