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: add (typed) array length to the default output #31027

Closed
wants to merge 2 commits into from

Conversation

BridgeAR
Copy link
Member

Align the inspect output with the one used in the Chrome dev tools.
A recent survey outlined that most users prefer to see the number
of set and map entries. This should count as well for array sizes.
The size is only added to regular arrays in case the constructor is
not the default constructor.
Typed arrays always indicate their size.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

Align the inspect output with the one used in the Chrome dev tools.
A recent survey outlined that most users prefer to see the number
of set and map entries. This should count as well for array sizes.
The size is only added to regular arrays in case the constructor is
not the default constructor.
Typed arrays always indicate their size.
@nodejs-github-bot nodejs-github-bot added the util Issues and PRs related to the built-in util module. label Dec 19, 2019
@targos
Copy link
Member

targos commented Dec 19, 2019

A few tests fail because it affects error messages (in a good way IMO).

@BridgeAR
Copy link
Member Author

@targos thanks, fixed. I got used to not running the full test suite but just use python tools/test.py -j4 test/*/*subsystem* :D

@nodejs-github-bot

This comment has been minimized.

@BridgeAR BridgeAR added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Dec 19, 2019
@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot
Copy link
Collaborator

nodejs-github-bot commented Dec 20, 2019

@Trott
Copy link
Member

Trott commented Dec 20, 2019

Might be worth a CITGM out of caution. I could see this kind of output change breaking a test somewhere unexpected.

@BridgeAR
Copy link
Member Author

BridgeAR commented Dec 21, 2019

CITGM is "green" (as in: no failures besides flakes)

Copy link
Contributor

@antsmartian antsmartian left a comment

Choose a reason for hiding this comment

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

Nice work.

BridgeAR added a commit that referenced this pull request Dec 25, 2019
Align the inspect output with the one used in the Chrome dev tools.
A recent survey outlined that most users prefer to see the number
of set and map entries. This should count as well for array sizes.
The size is only added to regular arrays in case the constructor is
not the default constructor.
Typed arrays always indicate their size.

PR-URL: #31027
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Anto Aravinth <[email protected]>
@BridgeAR
Copy link
Member Author

Landed in 489e77c 🎉

@BridgeAR BridgeAR closed this Dec 25, 2019
BridgeAR added a commit that referenced this pull request Jan 3, 2020
Align the inspect output with the one used in the Chrome dev tools.
A recent survey outlined that most users prefer to see the number
of set and map entries. This should count as well for array sizes.
The size is only added to regular arrays in case the constructor is
not the default constructor.
Typed arrays always indicate their size.

PR-URL: #31027
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Anto Aravinth <[email protected]>
@BridgeAR BridgeAR mentioned this pull request Jan 7, 2020
@targos
Copy link
Member

targos commented Jan 14, 2020

Probably blocked on previous PRs to land on v12.x-staging

BridgeAR added a commit to BridgeAR/node that referenced this pull request Jan 22, 2020
Align the inspect output with the one used in the Chrome dev tools.
A recent survey outlined that most users prefer to see the number
of set and map entries. This should count as well for array sizes.
The size is only added to regular arrays in case the constructor is
not the default constructor.
Typed arrays always indicate their size.

PR-URL: nodejs#31027
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Anto Aravinth <[email protected]>
MylesBorins pushed a commit that referenced this pull request Jan 30, 2020
Align the inspect output with the one used in the Chrome dev tools.
A recent survey outlined that most users prefer to see the number
of set and map entries. This should count as well for array sizes.
The size is only added to regular arrays in case the constructor is
not the default constructor.
Typed arrays always indicate their size.

Backport-PR-URL: #31431
PR-URL: #31027
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Anto Aravinth <[email protected]>
BethGriggs pushed a commit that referenced this pull request Feb 6, 2020
Align the inspect output with the one used in the Chrome dev tools.
A recent survey outlined that most users prefer to see the number
of set and map entries. This should count as well for array sizes.
The size is only added to regular arrays in case the constructor is
not the default constructor.
Typed arrays always indicate their size.

Backport-PR-URL: #31431
PR-URL: #31027
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Anto Aravinth <[email protected]>
@MylesBorins MylesBorins mentioned this pull request Feb 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. util Issues and PRs related to the built-in util module.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants