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

[v10.x] Backport util PRs #23039

Closed
wants to merge 7 commits into from
Closed

Commits on Sep 23, 2018

  1. util: remove outdated TODO

    PR-URL: nodejs#22503
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    Reviewed-By: John-David Dalton <john.david.dalton@gmail.com>
    Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
    Reviewed-By: Refael Ackermann <refack@gmail.com>
    BridgeAR authored and targos committed Sep 23, 2018
    Configuration menu
    Copy the full SHA
    3f0e52e View commit details
    Browse the repository at this point in the history
  2. benchmark: refactor util benchmarks

    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 <matteo.collina@gmail.com>
    Reviewed-By: John-David Dalton <john.david.dalton@gmail.com>
    Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
    Reviewed-By: Refael Ackermann <refack@gmail.com>
    BridgeAR authored and targos committed Sep 23, 2018
    Configuration menu
    Copy the full SHA
    0560cd0 View commit details
    Browse the repository at this point in the history
  3. util: improve inspect performance

    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 <matteo.collina@gmail.com>
    Reviewed-By: John-David Dalton <john.david.dalton@gmail.com>
    Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
    Reviewed-By: Refael Ackermann <refack@gmail.com>
    BridgeAR authored and targos committed Sep 23, 2018
    Configuration menu
    Copy the full SHA
    15b0c80 View commit details
    Browse the repository at this point in the history
  4. util: fix indentationLvl when exceeding max call stack size

    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 <jasnell@gmail.com>
    BridgeAR authored and targos committed Sep 23, 2018
    Configuration menu
    Copy the full SHA
    8513b45 View commit details
    Browse the repository at this point in the history
  5. util: use a shared symbol for util.inspect.custom

    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 <ruben@bridgewater.de>
    Reviewed-By: Anna Henningsen <anna@addaleax.net>
    Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
    Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    Reviewed-By: Michaël Zasso <targos@protonmail.com>
    Reviewed-By: John-David Dalton <john.david.dalton@gmail.com>
    chocolateboy authored and targos committed Sep 23, 2018
    Configuration menu
    Copy the full SHA
    cc9898b View commit details
    Browse the repository at this point in the history
  6. util: add order option to .inspect()

    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 <john.david.dalton@gmail.com>
    Reviewed-By: Anna Henningsen <anna@addaleax.net>
    Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
    BridgeAR authored and targos committed Sep 23, 2018
    Configuration menu
    Copy the full SHA
    c3ea927 View commit details
    Browse the repository at this point in the history
  7. doc,test: fix inspect's sorted compare function

    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 <ruben@bridgewater.de>
    Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Kyle Farnung <kfarnung@microsoft.com>
    targos committed Sep 23, 2018
    Configuration menu
    Copy the full SHA
    2b3af24 View commit details
    Browse the repository at this point in the history