Skip to content

Commit

Permalink
test: check inspect array with empty string key
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
mrahul17 authored and jasnell committed Sep 20, 2017
1 parent 354f320 commit cd238e2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/parallel/test-util-inspect.js
Original file line number Diff line number Diff line change
Expand Up @@ -959,6 +959,12 @@ if (typeof Symbol !== 'undefined') {
assert.strictEqual(util.inspect(x), '{}');
}

{
const x = [];
x[''] = 1;
assert.strictEqual(util.inspect(x), '[ \'\': 1 ]');
}

// The following maxArrayLength tests were introduced after v6.0.0 was released.
// Do not backport to v5/v4 unless all of
// https://github.com/nodejs/node/pull/6334 is backported.
Expand Down

0 comments on commit cd238e2

Please sign in to comment.