util: change items unknown style
We mainly use <> to visualize special information that is not directly visible as property. PR-URL: https://github.com/nodejs/node/pull/20792 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gus Caplan <me@gus.host>
This commit is contained in:
parent
0271b0f203
commit
e270ae9f01
@ -610,14 +610,14 @@ function formatValue(ctx, value, recurseTimes, ln) {
|
||||
if (ctx.showHidden) {
|
||||
formatter = formatWeakSet;
|
||||
} else {
|
||||
extra = '[items unknown]';
|
||||
extra = '<items unknown>';
|
||||
}
|
||||
} else if (isWeakMap(value)) {
|
||||
braces[0] = `${getPrefix(constructor, tag)}{`;
|
||||
if (ctx.showHidden) {
|
||||
formatter = formatWeakMap;
|
||||
} else {
|
||||
extra = '[items unknown]';
|
||||
extra = '<items unknown>';
|
||||
}
|
||||
} else if (types.isModuleNamespaceObject(value)) {
|
||||
braces[0] = `[${tag}] {`;
|
||||
|
@ -1310,7 +1310,7 @@ util.inspect(process);
|
||||
assert.strictEqual(out, expect);
|
||||
|
||||
out = util.inspect(weakMap);
|
||||
expect = 'WeakMap { [items unknown] }';
|
||||
expect = 'WeakMap { <items unknown> }';
|
||||
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 { <items unknown> }';
|
||||
assert.strictEqual(out, expect);
|
||||
|
||||
out = util.inspect(weakSet, { maxArrayLength: -2, showHidden: true });
|
||||
|
Loading…
x
Reference in New Issue
Block a user