Fix issues with __proto__ fields in json domain#12692
Merged
Merged
Conversation
jenn-le
approved these changes
Oct 26, 2022
CraigMacomber
added a commit
that referenced
this pull request
Oct 27, 2022
## Description Fix bug in #12692 . Old version of the assignment was accidently left in one spot after restoring it to do performance comparison.
| @@ -119,6 +119,13 @@ export function cursorToJsonObject(reader: ITreeCursor): JsonCompatible { | |||
| const key = cursor.getFieldKey() as LocalFieldKey; | |||
| assert(cursor.firstNode(), 0x420 /* expected non-empty field */); | |||
| result[key] = cursorToJsonObject(reader); | |||
Contributor
There was a problem hiding this comment.
Did you forget to delete this line?
sharptrip
pushed a commit
to sharptrip/FluidFramework
that referenced
this pull request
Oct 28, 2022
## Description Fix same bug as in microsoft#12687 except in cursorToJsonObject and generic JS object clone code for perf comparison. The old code would change the prototype of the object (via the __proto__ field defined on the prototype), while the new code adds an enumerable own property that shadows __proto__. benchmarks show a slight slowdown with this change, around 2-3% for cursorToJsonObject, and around 6% for the raw JS object clone reference.
sharptrip
pushed a commit
to sharptrip/FluidFramework
that referenced
this pull request
Oct 28, 2022
## Description Fix bug in microsoft#12692 . Old version of the assignment was accidently left in one spot after restoring it to do performance comparison.
alexvy86
pushed a commit
to alexvy86/FluidFramework
that referenced
this pull request
Nov 1, 2022
## Description Fix bug in microsoft#12692 . Old version of the assignment was accidently left in one spot after restoring it to do performance comparison.
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.
Description
Fix same bug as in #12687 except in cursorToJsonObject and generic JS object clone code for perf comparison.
The old code would change the prototype of the object (via the proto field defined on the prototype), while the new code adds an enumerable own property that shadows proto.
benchmarks show a slight slowdown with this change, around 2-3% for cursorToJsonObject, and around 6% for the raw JS object clone reference.