Skip to content

Commit

Permalink
test: check util.inspect for array having empty string as key
Browse files Browse the repository at this point in the history
  • Loading branch information
mrahul17 committed Sep 8, 2017
1 parent 11b7428 commit 0ea06ff
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 0ea06ff

Please sign in to comment.