Serialization also calls inherited toJSON#1732
Open
nechaev-chromium wants to merge 1 commit intow3c:masterfrom
Open
Serialization also calls inherited toJSON#1732nechaev-chromium wants to merge 1 commit intow3c:masterfrom
nechaev-chromium wants to merge 1 commit intow3c:masterfrom
Conversation
whimboo
reviewed
May 26, 2023
Contributor
whimboo
left a comment
There was a problem hiding this comment.
Generally it looks fine to me but I wonder what might be missing in case an object inherits toJSON() and defines some own properties. In case handling only an own toJSON() call, we could assume that the object knows what to serialize, but if we call it on one of the super classes it might miss values?
@jgraham what do you think?
|
|
||
| <dt>has an <a>own property</a> named "<code>toJSON</code>" that is | ||
| a <a>Function</a> | ||
| <dt>has an <a>own property</a> or <a>inherited property</a> named |
Contributor
There was a problem hiding this comment.
Suggested change
| <dt>has an <a>own property</a> or <a>inherited property</a> named | |
| <dt>has a property</a> named |
Given that it doesn't matter if it's an own or inherited property we potentially could just use this term?
MurkyWaters2
approved these changes
Nov 12, 2024
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
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.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.
Serialization mechanism calls not only own toJSON method but also inherited toJSON method of the serialized object
Fixing Call of toJSON in the internal JSON clone algorithm.
Preview | Diff