Skip to content

Revert 17907: util: change inspect depth default

Rodrigo Muino Tomonari requested to merge github/fork/addaleax/revert-17907 into master
  • Revert "util: change util.inspect depth default"

    This reverts commit b994b8ef.

    This caused regressions in ecosystem code. While the change originally was semver-major and could be postponed until after Node.js 10, I think reverting it is a good choice at this point.

    Also, I personally do not think defaulting to a shallow inspect is a bad thing at all – quite the opposite: It makes util.inspect() give an overview of an object, rather than providing a full display of its contents. Changing the depth default to infinity fundamentally changed the role that util.inspect() plays, and makes output much more verbose and thus at times unusable for console.log()-style debugging.

    Fixes: https://github.com/nodejs/node/issues/19405 Refs: https://github.com/nodejs/node/pull/17907

  • Revert "util: change %o depth default"

    This reverts commit 8f153092.

(https://github.com/nodejs/node/pull/19994 also has a Fixes: tag for https://github.com/nodejs/node/issues/19405, but it’s independent from this PR and is not uncontroversial)

  • 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

Merge request reports

Loading