mirror of
https://github.com/nodejs/node.git
synced 2026-11-21 12:59:16 -05:00
util: fix map entries inspection
This makes sure the arrays returned by Map#entries() are handled as any other array instead of just visualizing the entries as array. Therefore options should have an impact on the arrays. PR-URL: https://github.com/nodejs/node/pull/26918 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com>
This commit is contained in:
2 files changed
+19
-15
No files matched your search
@@ -1017,7 +1017,10 @@ if (typeof Symbol !== 'undefined') {
|
||||
|
||||
// Test Set iterators.
|
||||
{
|
||||
const aSet = new Set([1, 3]);
|
||||
const aSet = new Set([1]);
|
||||
assert.strictEqual(util.inspect(aSet.entries(), { compact: false }),
|
||||
'[Set Entries] {\n [\n 1,\n 1\n ]\n}');
|
||||
aSet.add(3);
|
||||
assert.strictEqual(util.inspect(aSet.keys()), '[Set Iterator] { 1, 3 }');
|
||||
assert.strictEqual(util.inspect(aSet.values()), '[Set Iterator] { 1, 3 }');
|
||||
const setEntries = aSet.entries();
|
||||
|
||||
Reference in new issue
Block a user