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: inspect all prototypes #24974

Closed
wants to merge 1 commit into from

Conversation

BridgeAR
Copy link
Member

It is currently difficult to distinguish multiple objects from each
other because the prototype is not properly inspected. From now on
all prototypes will be inspected, even if we do not fully know how
they will look like / what there shape really is.

Fixes: #24917

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

@nodejs-github-bot nodejs-github-bot added the util Issues and PRs related to the built-in util module. label Dec 11, 2018
It is currently difficult to distinguish multiple objects from each
other because the prototype is not properly inspected. From now on
all prototypes will be inspected, even if we do not fully know how
they will look like / what their shape really is.

Fixes: nodejs#24917
@lpinca
Copy link
Member

lpinca commented Dec 12, 2018

Does the test case in #24917 now produces an error message that starts with

Expected values to be strictly deep-equal:

for both variants?

@BridgeAR
Copy link
Member Author

@lpinca correct. assert uses util.inspect() to inspect the input values and then transforms that into the actual output.

With this solution prototypes will almost always be properly distinguishable. There are a few edge cases left where that's not the case but they should be negligible. It's just hard to guarantee that different inputs will actually also produce a different output.

@BridgeAR
Copy link
Member Author

BridgeAR commented Dec 12, 2018

@BridgeAR BridgeAR added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Dec 12, 2018
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.

LGTM

@Trott
Copy link
Member

Trott commented Dec 14, 2018

Resume Build CI: https://ci.nodejs.org/job/node-test-commit/24292/ ✔️

@BridgeAR
Copy link
Member Author

@nodejs/util PTAL. I would like to get another review for this one.

BridgeAR added a commit to BridgeAR/node that referenced this pull request Dec 16, 2018
It is currently difficult to distinguish multiple objects from each
other because the prototype is not properly inspected. From now on
all prototypes will be inspected, even if we do not fully know how
they will look like / what their shape really is.

PR-URL: nodejs#24974
Fixes: nodejs#24917
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Anto Aravinth <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@BridgeAR
Copy link
Member Author

Landed in 02b66b5

@BridgeAR BridgeAR closed this Dec 16, 2018
BethGriggs pushed a commit that referenced this pull request Dec 18, 2018
It is currently difficult to distinguish multiple objects from each
other because the prototype is not properly inspected. From now on
all prototypes will be inspected, even if we do not fully know how
they will look like / what their shape really is.

PR-URL: #24974
Fixes: #24917
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Anto Aravinth <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@BethGriggs BethGriggs mentioned this pull request Dec 18, 2018
refack pushed a commit to refack/node that referenced this pull request Jan 14, 2019
It is currently difficult to distinguish multiple objects from each
other because the prototype is not properly inspected. From now on
all prototypes will be inspected, even if we do not fully know how
they will look like / what their shape really is.

PR-URL: nodejs#24974
Fixes: nodejs#24917
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Anto Aravinth <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@BridgeAR BridgeAR deleted the inspect-weird-prototypes branch January 20, 2020 11:44
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.

Misleading error message
7 participants