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 <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
  • Loading branch information
mrahul17 authored and BridgeAR committed Sep 11, 2017
1 parent f154c83 commit 21a3ae3
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 @@ -968,6 +968,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 21a3ae3

Please sign in to comment.