Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9cebe82

Browse filesBrowse files
mrahul17MylesBorins
authored andcommitted
test: check inspect array with empty string key
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>
1 parent 713f239 commit 9cebe82
Copy full SHA for 9cebe82

File tree

Expand file treeCollapse file tree

1 file changed

+6
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-0
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-util-inspect.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-util-inspect.js
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -831,6 +831,12 @@ checkAlignment(new Map(big_array.map(function(y) { return [y, null]; })));
831831
assert.strictEqual(util.inspect(x), '{}');
832832
}
833833

834+
{
835+
const x = [];
836+
x[''] = 1;
837+
assert.strictEqual(util.inspect(x), '[ \'\': 1 ]');
838+
}
839+
834840
// The following maxArrayLength tests were introduced after v6.0.0 was released.
835841
// Do not backport to v5/v4 unless all of
836842
// https://github.com/nodejs/node/pull/6334 is backported.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.