diff --git a/lib/util.js b/lib/util.js index 776fcdb0d39653..46ae1724a7c0fb 100644 --- a/lib/util.js +++ b/lib/util.js @@ -610,14 +610,14 @@ function formatValue(ctx, value, recurseTimes, ln) { if (ctx.showHidden) { formatter = formatWeakSet; } else { - extra = '[items unknown]'; + extra = ''; } } else if (isWeakMap(value)) { braces[0] = `${getPrefix(constructor, tag)}{`; if (ctx.showHidden) { formatter = formatWeakMap; } else { - extra = '[items unknown]'; + extra = ''; } } else if (types.isModuleNamespaceObject(value)) { braces[0] = `[${tag}] {`; diff --git a/test/parallel/test-util-inspect.js b/test/parallel/test-util-inspect.js index e3122d1b81e72b..b9ed02ddc4a69e 100644 --- a/test/parallel/test-util-inspect.js +++ b/test/parallel/test-util-inspect.js @@ -1310,7 +1310,7 @@ util.inspect(process); assert.strictEqual(out, expect); out = util.inspect(weakMap); - expect = 'WeakMap { [items unknown] }'; + expect = 'WeakMap { }'; assert.strictEqual(out, expect); out = util.inspect(weakMap, { maxArrayLength: 0, showHidden: true }); @@ -1334,7 +1334,7 @@ util.inspect(process); assert.strictEqual(out, expect); out = util.inspect(weakSet); - expect = 'WeakSet { [items unknown] }'; + expect = 'WeakSet { }'; assert.strictEqual(out, expect); out = util.inspect(weakSet, { maxArrayLength: -2, showHidden: true });