Skip to content

Commit 21a3ae3

Browse files
mrahul17BridgeAR
authored andcommitted
test: check inspect array with empty string key
PR-URL: #15258 Refs: #15159 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
1 parent f154c83 commit 21a3ae3

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

test/parallel/test-util-inspect.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -968,6 +968,12 @@ if (typeof Symbol !== 'undefined') {
968968
assert.strictEqual(util.inspect(x), '{}');
969969
}
970970

971+
{
972+
const x = [];
973+
x[''] = 1;
974+
assert.strictEqual(util.inspect(x), '[ \'\': 1 ]');
975+
}
976+
971977
// The following maxArrayLength tests were introduced after v6.0.0 was released.
972978
// Do not backport to v5/v4 unless all of
973979
// https://github.com/nodejs/node/pull/6334 is backported.

0 commit comments

Comments
 (0)