Skip to content

util: use [Array] for deeply nested arrays - #12046

Closed
addaleax wants to merge 1 commit into
nodejs:masterfrom
addaleax:util-deep-array
Closed

util: use [Array] for deeply nested arrays#12046
addaleax wants to merge 1 commit into
nodejs:masterfrom
addaleax:util-deep-array

Conversation

@addaleax

@addaleaxaddaleax commented Mar 26, 2017

Copy link
Copy Markdown
Member

Prefer [Array] over [Object] because the latter is confusing.

I may be mistaken but I think this was brought up somewhere a few weeks ago (?) – I couldn’t find anything, but if somebody has a Fixes: tag I’ll happily ad it, and if this is a duplicate, I’ll happily close the PR. :)

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

util

@addaleaxaddaleax added semver-major PRs that contain breaking changes and should be released in the next major version. util Issues and PRs related to the built-in util module. labels Mar 26, 2017
@vsemozhetbyt

vsemozhetbyt commented Mar 26, 2017

Copy link
Copy Markdown
Contributor

@addaleax Is this what you have lost? :)

@addaleax

Copy link
Copy Markdown
MemberAuthor

@vsemozhetbyt Yes, thank you. :)

Prefer `[Array]` over `[Object]` because the latter is confusing.
Ref: nodejs#11651
PR-URL: nodejs#12046

@evanlucasevanlucas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I've been wanting this for a while :]

@cjihrigcjihrig left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Do you know if there are any tests that still cover the else logic?

@@ -72,6 +72,8 @@ assert.strictEqual(util.inspect({'a': {'b': { 'c': 2}}}, false, 0),
'{ a: [Object] }');
assert.strictEqual(util.inspect({'a': {'b': { 'c': 2}}}, false, 1),
'{ a: { b: [Object] } }');

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cjihrig This should keep covering the else branch

@Fishrock123Fishrock123 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@addaleax

addaleax commented Mar 28, 2017

Copy link
Copy Markdown
MemberAuthor

CI: https://ci.nodejs.org/job/node-test-commit/8722/ (oops, didn’t see Jeremiah’s CI run … ¯\_(ツ)_/¯)
CITGM: https://ci.nodejs.org/view/Node.js-citgm/job/citgm-smoker/674/

@jasnell

Copy link
Copy Markdown
Member

CI failures are unrelated.

jasnell pushed a commit that referenced this pull request Mar 28, 2017
Prefer `[Array]` over `[Object]` because the latter is confusing.
PR-URL: #12046
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
@jasnell

Copy link
Copy Markdown
Member

Landed in 4a5a944

@jasnelljasnell closed this Mar 28, 2017
@jasnelljasnell mentioned this pull request Apr 4, 2017
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver-majorPRs that contain breaking changes and should be released in the next major version.utilIssues and PRs related to the built-in util module.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@addaleax@vsemozhetbyt@jasnell@evanlucas@Fishrock123@targos@cjihrig