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 — util: improve internal `isError()` validation by BridgeAR · Pull Request #24746 · nodejs/node

Conversation

@BridgeAR

@BridgeAR BridgeAR commented Nov 30, 2018 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

The current internal isError function checked the toString value
instead of using the more precise util.types.isNativeError() check.
The instanceof check is not removed due to possible errors that
are not native but still an instance of Error.

The internal isError function is only used in util.inspect() and the repl.

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

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
util: improve internal isError() validation
ab135e7
The current internal isError function checked the toString value
instead of using the more precise `util.types.isNativeError()` check.
The `instanceof` check is not removed due to possible errors that
are not native but still an instance of Error.
@nodejs-github-bot

nodejs-github-bot commented Nov 30, 2018

Copy link
Copy Markdown
Collaborator

@BridgeAR build started: https://ci.nodejs.org/blue/organizations/jenkins/node-test-pull-request-lite-pipeline/detail/node-test-pull-request-lite-pipeline/1740/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 the util Issues and PRs related to the built-in util module. label Nov 30, 2018
@BridgeAR

BridgeAR commented Nov 30, 2018

Copy link
Copy Markdown
Member Author

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

All reactions

Sorry, something went wrong.

Uh oh!

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

sam-github
sam-github reviewed Nov 30, 2018
View reviewed changes

@sam-github sam-github left a comment

Copy link
Copy Markdown
Contributor

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.

I think this should have some unit tests, specifically, some that failed before the change and succeed afterwards. My js isn't good enough, I don't understand the subtleties of how it is becoming more precise, and was hoping to learn what corner cases are better covered from the tests.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread lib/util.js Resolved

Uh oh!

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

@BridgeAR
fixup: add test case
9009e4c
@BridgeAR

BridgeAR commented Nov 30, 2018

Copy link
Copy Markdown
Member Author

I just pushed some tests as well.

All reactions

Sorry, something went wrong.

Uh oh!

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

@BridgeAR

BridgeAR commented Dec 2, 2018

Copy link
Copy Markdown
Member Author

@nodejs/util PTAL

All reactions

Sorry, something went wrong.

Uh oh!

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

targos
targos approved these changes Dec 2, 2018
View reviewed changes
joyeecheung
joyeecheung reviewed Dec 2, 2018
View reviewed changes
Comment thread lib/internal/util.js Resolved

Uh oh!

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

@BridgeAR
fixup: add further test case
434eb41
joyeecheung
joyeecheung reviewed Dec 2, 2018
View reviewed changes
Comment thread test/parallel/test-internal-util-helpers.js Resolved

Uh oh!

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

BridgeAR added 2 commits December 2, 2018 21:05
@BridgeAR
fixup: more verbose comment
d346011
@BridgeAR
fixup: add test explanation
ddc82e4
joyeecheung
joyeecheung approved these changes Dec 2, 2018
View reviewed changes
@BridgeAR

BridgeAR commented Dec 2, 2018

Copy link
Copy Markdown
Member Author

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

All reactions

Sorry, something went wrong.

Uh oh!

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

@BridgeAR BridgeAR added the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Dec 2, 2018
BridgeAR added a commit to BridgeAR/node that referenced this pull request Dec 3, 2018
@BridgeAR
util: improve internal isError() validation
2b5f2bc
The current internal isError function checked the toString value
instead of using the more precise `util.types.isNativeError()` check.
The `instanceof` check is not removed due to possible errors that
are not native but still an instance of Error.

PR-URL: nodejs#24746
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
@BridgeAR

BridgeAR commented Dec 3, 2018

Copy link
Copy Markdown
Member Author

Landed in 2b5f2bc

All reactions

Sorry, something went wrong.

Uh oh!

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

@BridgeAR BridgeAR closed this Dec 3, 2018
BridgeAR added a commit that referenced this pull request Dec 5, 2018
@BridgeAR
util: improve internal isError() validation
807c108
The current internal isError function checked the toString value
instead of using the more precise `util.types.isNativeError()` check.
The `instanceof` check is not removed due to possible errors that
are not native but still an instance of Error.

PR-URL: #24746
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
@BridgeAR BridgeAR mentioned this pull request Dec 5, 2018
v11.4.0 proposal #24854
Merged
4 tasks done
This was referenced Dec 7, 2018
2018-12-07 Version 11.4.0 (Current) @BridgeAR beevelop/docker-android-nodejs#261
Closed
2018-12-07 Version 11.4.0 (Current) @BridgeAR beevelop/docker-android-nodejs#262
Closed
2018-12-07 Version 11.4.0 (Current) @BridgeAR beevelop/docker-android-nodejs#263
Closed
2018-12-07 Version 11.4.0 (Current) @BridgeAR beevelop/docker-android-nodejs#264
Closed
2018-12-07 Version 11.4.0 (Current) @BridgeAR beevelop/docker-android-nodejs#265
Closed
refack pushed a commit to refack/node that referenced this pull request Jan 14, 2019
@BridgeAR @refack
util: improve internal isError() validation
e167a9e
The current internal isError function checked the toString value
instead of using the more precise `util.types.isNativeError()` check.
The `instanceof` check is not removed due to possible errors that
are not native but still an instance of Error.

PR-URL: nodejs#24746
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
@BethGriggs BethGriggs added the dont-land-on-v10.x label Jul 3, 2019
@BridgeAR
BridgeAR deleted the improve-is-error branch January 20, 2020 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@joyeecheung joyeecheung joyeecheung approved these changes
+3 more reviewers
@sam-github sam-github sam-github left review comments
@devsnek devsnek devsnek left review comments
@targos targos targos approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

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

Assignees

No one assigned

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. 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.

7 participants

@BridgeAR @nodejs-github-bot @sam-github @targos @joyeecheung @devsnek @BethGriggs
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 01402520 — 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.