Skip to content

[v12.x] backport #27685 #29011

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

Closed
wants to merge 3 commits into from

Conversation

BridgeAR
Copy link
Member

@BridgeAR BridgeAR commented Aug 6, 2019

This backports #27685 (a semver-major PR) with a compatibility patch on top.

The main code change works similar to a no-op.

@nodejs/util @nodejs/releasers PTAL

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

This adds a reference anchor to circular structures when using
`util.inspect`. That way it's possible to identify with what object
the circular reference corresponds too.

PR-URL: nodejs#27685
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
This patch makes sure no breaking changes from the referenced
semver-major PR are backported.

Refs: nodejs#27685
@nodejs-github-bot nodejs-github-bot added util Issues and PRs related to the built-in util module. v12.x labels Aug 6, 2019
Copy link
Member

@gengjiawen gengjiawen left a comment

Choose a reason for hiding this comment

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

Test failed with:

=== release test-util-inspect ===
Path: parallel/test-util-inspect
--- stderr ---
assert.js:89
  throw new AssertionError(obj);
  ^
AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
+ actual - expected
+ '{ a: [ [Circular] ], b: { inner: [Circular], obj: [Circular] } }'
- '{\n  a: [ [Circular] ],\n  b: { inner: [Circular], obj: [Circular] }\n}'
    at Object.<anonymous> (/home/travis/build/nodejs/node/test/parallel/test-util-inspect.js:1061:10)
    at Module._compile (internal/modules/cjs/loader.js:868:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:879:10)
    at Module.load (internal/modules/cjs/loader.js:731:32)
    at Function.Module._load (internal/modules/cjs/loader.js:644:12)
    at Function.Module.runMain (internal/modules/cjs/loader.js:931:10)
    at internal/main/run_main_module.js:17:11 {
  generatedMessage: true,
  code: 'ERR_ASSERTION',
  actual: '{ a: [ [Circular] ], b: { inner: [Circular], obj: [Circular] } }',
  expected: '{\n  a: [ [Circular] ],\n  b: { inner: [Circular], obj: [Circular] }\n}',
  operator: 'strictEqual'
}
Command: out/Release/node --expose-internals /home/travis/build/nodejs/node/test/parallel/test-util-inspect.js

@nodejs-github-bot
Copy link
Collaborator

@BridgeAR
Copy link
Member Author

BridgeAR commented Sep 24, 2019

@nodejs/releasers PTAL

It's not super important but I would like to land this backport soon.

@BridgeAR BridgeAR requested a review from gengjiawen September 24, 2019 20:03
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@Trott
Copy link
Member

Trott commented Sep 25, 2019

Lint failure in CI explained in #29695 (comment). Two commits need to be removed from v12.x-staging, probably.

@BridgeAR
Copy link
Member Author

Landed on staging ced89ad

@BridgeAR BridgeAR closed this Sep 25, 2019
@BridgeAR BridgeAR deleted the v12.x-backport-27685 branch January 20, 2020 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
util Issues and PRs related to the built-in util module.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants