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 <luigipinca@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
1 parent f154c83 commit 21a3ae3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

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)