Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wants to merge 1 commit into from

Conversation

addaleax
Copy link
Member

@addaleax addaleax commented Mar 26, 2017

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

@addaleax addaleax 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
Copy link
Contributor

vsemozhetbyt commented Mar 26, 2017

@addaleax Is this what you have lost? :)

@addaleax
Copy link
Member Author

@vsemozhetbyt Yes, thank you. :)

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

Ref: nodejs#11651
PR-URL: nodejs#12046
Copy link
Contributor

@evanlucas evanlucas left a comment

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 :]

Copy link
Contributor

@cjihrig cjihrig left a comment

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
Member Author

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

Copy link
Contributor

@Fishrock123 Fishrock123 left a comment

Choose a reason for hiding this comment

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

@addaleax
Copy link
Member Author

addaleax commented Mar 28, 2017

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
Member

jasnell commented Mar 28, 2017

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 <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Jeremiah Senkpiel <[email protected]>
@jasnell
Copy link
Member

jasnell commented Mar 28, 2017

Landed in 4a5a944

@jasnell jasnell closed this Mar 28, 2017
@jasnell jasnell mentioned this pull request Apr 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants