Editorial: pass necessary arguments to SerializeJSON*#1890
Merged
Conversation
ljharb
approved these changes
Mar 6, 2020
Member
Author
|
Hm. Asserting that something is a Record isn't all that useful, since that tells you nothing about the fields in that record, which are just as important. So I think I'd prefer to omit those assertions, though it's not a strong preference. |
Member
|
In general I prefer abstract ops to assert about their arguments as strongly as possible; certainly we could make a JSONStateRecord type and assert it's one of those (which would include the slots), but that feels a bit overkill here. |
Member
Author
|
I agree that it feels like overkill to make such an assertion, but at that point I don't really see the value of making any assertion at all. There's nowhere else in the spec we just assert something is a Record, as far as I know. |
michaelficarra
approved these changes
Mar 12, 2020
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.
SerializeJSONProperty,SerializeJSONObject, andSerializeJSONArrayrefer to variables which they have not been passed using notation likeSerializeJSONProperty has access to _ReplacerFunction_ from the invocation of the `stringify` method.I find this sketchy (see #1884).
This PR makes all the necessary values be passed explicitly, wrapped up in a Record.