Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
test: check util.inspect for array having empty string as key
Refs: #15159
  • Loading branch information
mrahul17 committed Sep 8, 2017
commit 0ea06ff8949b1e6cc0d0f135d2f8960a8a054a6c
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