GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [v10.x] Backport util PRs by targos · Pull Request #23039 · nodejs/node

Conversation

@targos

@targos targos commented Sep 23, 2018

Copy link
Copy Markdown
Member

Backport of #22503, #22787, #20857, #22788 and #22992.
Closes #22872

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bricss reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
BridgeAR and others added 7 commits September 23, 2018 18:49
@BridgeAR @targos
util: remove outdated TODO
3f0e52e
PR-URL: nodejs#22503
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: John-David Dalton <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
@BridgeAR @targos
benchmark: refactor util benchmarks
0560cd0
This significantly reduces the benchmark runtime. It removes to many
variations that do not provide any benefit and reduces the iterations.

PR-URL: nodejs#22503
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: John-David Dalton <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
@BridgeAR @targos
util: improve inspect performance
15b0c80
This significantly improves the inspection performance for all array
types. From now on only the visible elements cause work instead of
having to process all array keys no matter how many entries are
visible.

This also moves some code out of the main function to reduce the
overall function complexity.

PR-URL: nodejs#22503
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: John-David Dalton <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
@BridgeAR @targos
util: fix indentationLvl when exceeding max call stack size
8513b45
The inspection indentation level was not always reset to it's former
value in case the maximum call stack size was exceeded.

PR-URL: nodejs#22787
Reviewed-By: James M Snell <[email protected]>
@chocolateboy @targos
util: use a shared symbol for util.inspect.custom
cc9898b
Define `util.inspect.custom` as
`Symbol.for("nodejs.util.inspect.custom")` rather than
`Symbol("util.inspect.custom")`. This allows `inspect` hooks to
easily/safely be defined in non-Node.js environments.

Fixes: nodejs#20821
Refs: nodejs#22684

PR-URL: nodejs#20857
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Tiancheng "Timothy" Gu <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: John-David Dalton <[email protected]>
@BridgeAR @targos
util: add order option to .inspect()
c3ea927
The order option can be used to sort the inspected values in case
they do not rely on their order as arrays. That way the output is
stable no matter of the object property inspection order.

PR-URL: nodejs#22788
Refs: nodejs#22763
Reviewed-By: John-David Dalton <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
@targos
doc,test: fix inspect's sorted compare function
2b3af24
In V8 7.0, the array sorting algorithm was changed to Timsort, which
is stable. A compare function returning only `true` or `false`
(converted to 0 and 1) cannot work properly.

PR-URL: nodejs#22992
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Kyle Farnung <[email protected]>
@targos targos added util Issues and PRs related to the built-in util module. v10.x labels Sep 23, 2018
@nodejs-github-bot

nodejs-github-bot commented Sep 23, 2018

Copy link
Copy Markdown
Collaborator

@targos build started: https://ci.nodejs.org/blue/organizations/jenkins/node-test-pull-request-lite-pipeline/detail/node-test-pull-request-lite-pipeline/984/pipeline

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot nodejs-github-bot added util Issues and PRs related to the built-in util module. v10.x labels Sep 23, 2018
@targos

targos commented Sep 23, 2018

Copy link
Copy Markdown
Member Author

CI: https://ci.nodejs.org/job/node-test-pull-request/17384/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@targos
targos requested a review from BridgeAR September 24, 2018 15:42
BridgeAR
BridgeAR approved these changes Sep 24, 2018
View reviewed changes

@BridgeAR BridgeAR left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

LGTM. Thanks a lot for backporting these!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@BridgeAR

BridgeAR commented Sep 24, 2018

Copy link
Copy Markdown
Member

I am going to backport #22845 when this landed.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

targos pushed a commit that referenced this pull request Sep 24, 2018
@BridgeAR @targos
util: remove outdated TODO
92e0f38
Backport-PR-URL: #23039
PR-URL: #22503
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: John-David Dalton <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
targos pushed a commit that referenced this pull request Sep 24, 2018
@BridgeAR @targos
benchmark: refactor util benchmarks
90bbab6
This significantly reduces the benchmark runtime. It removes to many
variations that do not provide any benefit and reduces the iterations.

Backport-PR-URL: #23039
PR-URL: #22503
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: John-David Dalton <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
targos pushed a commit that referenced this pull request Sep 24, 2018
@BridgeAR @targos
util: improve inspect performance
5a13e66
This significantly improves the inspection performance for all array
types. From now on only the visible elements cause work instead of
having to process all array keys no matter how many entries are
visible.

This also moves some code out of the main function to reduce the
overall function complexity.

Backport-PR-URL: #23039
PR-URL: #22503
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: John-David Dalton <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
targos pushed a commit that referenced this pull request Sep 24, 2018
@BridgeAR @targos
util: fix indentationLvl when exceeding max call stack size
077e7e0
The inspection indentation level was not always reset to it's former
value in case the maximum call stack size was exceeded.

Backport-PR-URL: #23039
PR-URL: #22787
Reviewed-By: James M Snell <[email protected]>
targos pushed a commit that referenced this pull request Sep 24, 2018
@chocolateboy @targos
util: use a shared symbol for util.inspect.custom
a2a1ebf
Define `util.inspect.custom` as
`Symbol.for("nodejs.util.inspect.custom")` rather than
`Symbol("util.inspect.custom")`. This allows `inspect` hooks to
easily/safely be defined in non-Node.js environments.

Fixes: #20821
Refs: #22684

Backport-PR-URL: #23039
PR-URL: #20857
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Tiancheng "Timothy" Gu <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: John-David Dalton <[email protected]>
targos pushed a commit that referenced this pull request Sep 24, 2018
@BridgeAR @targos
util: add order option to .inspect()
68eaa87
The order option can be used to sort the inspected values in case
they do not rely on their order as arrays. That way the output is
stable no matter of the object property inspection order.

Backport-PR-URL: #23039
PR-URL: #22788
Refs: #22763
Reviewed-By: John-David Dalton <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
targos added a commit that referenced this pull request Sep 24, 2018
@targos
doc,test: fix inspect's sorted compare function
b48dc0b
In V8 7.0, the array sorting algorithm was changed to Timsort, which
is stable. A compare function returning only `true` or `false`
(converted to 0 and 1) cannot work properly.

Backport-PR-URL: #23039
PR-URL: #22992
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Kyle Farnung <[email protected]>
@targos

targos commented Sep 24, 2018 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

Landed in e16dd6d...b48dc0b

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@targos targos closed this Sep 24, 2018
@targos
targos deleted the v10-util-backports branch September 24, 2018 19:38
@targos targos mentioned this pull request Sep 25, 2018
[v10.x needs a backport] - repl: improve error output #22710
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@BridgeAR BridgeAR BridgeAR approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

util Issues and PRs related to the built-in util module.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@targos @nodejs-github-bot @BridgeAR @chocolateboy
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.