Repository navigation
errors: extract type detection & use in ERR_INVALID_RETURN_VALUE
#43558
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
Merged
nodejs-github-bot
merged 7 commits into
nodejs:main
from
JakobJingleheimer:errors/account-for-specific-types-in-return-value
Jul 1, 2022
Merged
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
74be6fe
errors: extract type detection & use in `ERR_INVALID_RETURN_VALUE`
JakobJingleheimer 572c162
fixup! errors: extract type detection & use in `ERR_INVALID_RETURN_VA…
JakobJingleheimer 4a4204e
fixup! fixup! errors: extract type detection & use in `ERR_INVALID_RE…
JakobJingleheimer b757821
fixup! fixup! fixup! errors: extract type detection & use in `ERR_INV…
JakobJingleheimer 4871b85
fixup! fixup! fixup! fixup! errors: extract type detection & use in `…
JakobJingleheimer 96dbd0e
fixup! fixup! fixup! fixup! fixup! errors: extract type detection & u…
JakobJingleheimer d2eded5
fixup! fixup! fixup! fixup! fixup! fixup! errors: extract type detect…
JakobJingleheimer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fixup! fixup! fixup! fixup! fixup! errors: extract type detection & u…
…se in `ERR_INVALID_RETURN_VALUE` revert type determination output for objects without a constructor
- Loading branch information
commit 96dbd0e2e8a36259bc23c4347e033e5559ea0117
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -736,8 +736,11 @@ function invalidArgTypeHelper(input) { | |||||
| if (typeof input === 'function' && input.name) { | ||||||
| return ` Received function ${input.name}`; | ||||||
| } | ||||||
| if (typeof input === 'object' && input.constructor?.name) { | ||||||
| return ` Received an instance of ${input.constructor.name}`; | ||||||
| if (typeof input === 'object') { | ||||||
| if (input?.constructor?.name) { | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
We know for certain that |
||||||
| return ` Received an instance of ${input.constructor.name}`; | ||||||
| } | ||||||
| return ` Received ${inspect(input, { depth: -1 })}`; | ||||||
| } | ||||||
|
|
||||||
| let inspected = inspect(input, { colors: false }); | ||||||
|
|
||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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.