diff --git a/test/parallel/test-util-inspect.js b/test/parallel/test-util-inspect.js index 6bfce5abcbb421..f4e7bb9e5ba7ff 100644 --- a/test/parallel/test-util-inspect.js +++ b/test/parallel/test-util-inspect.js @@ -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.