Perfect your code
With built-in code review tools, GitHub makes it easy to raise the quality bar before you ship. Join the 36 million developers who've merged over 200 million pull requests.
Sign up for free See pricing for teams and enterprisesutil: improve internal `isError()` validation #24746
Conversation
This comment has been minimized.
This comment has been minimized.
nodejs-github-bot
added
the
util
label
Nov 30, 2018
This comment has been minimized.
This comment has been minimized.
sam-github
reviewed
Nov 30, 2018
|
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. |
This comment has been minimized.
This comment has been minimized.
|
I just pushed some tests as well. |
This comment has been minimized.
This comment has been minimized.
|
@nodejs/util PTAL |
targos
approved these changes
Dec 2, 2018
BridgeAR
added some commits
Dec 2, 2018
joyeecheung
approved these changes
Dec 2, 2018
This comment has been minimized.
This comment has been minimized.
BridgeAR
added
the
author ready
label
Dec 2, 2018
BridgeAR
added a commit
to BridgeAR/node
that referenced
this pull request
Dec 3, 2018
This comment has been minimized.
This comment has been minimized.
|
Landed in 2b5f2bc |
BridgeAR
closed this
Dec 3, 2018
BridgeAR
added a commit
that referenced
this pull request
Dec 5, 2018
BridgeAR
added a commit
that referenced
this pull request
Dec 5, 2018
This was referenced Dec 7, 2018
refack
added a commit
to refack/node
that referenced
this pull request
Jan 14, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
BridgeAR commentedNov 30, 2018
•
edited
The current internal isError function checked the toString value
instead of using the more precise
util.types.isNativeError()check.The
instanceofcheck is not removed due to possible errors thatare not native but still an instance of Error.
The internal
isErrorfunction is only used inutil.inspect()and therepl.Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes