Skip to content
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

fix(document): correct context for default functions in subdocuments with init #12427

Merged
merged 2 commits into from Sep 14, 2022

Conversation

vkarpov15
Copy link
Collaborator

@vkarpov15 vkarpov15 commented Sep 14, 2022

Fix #12328

Summary

#12328 pointed out that, when initializing a subdocument, we call default functions before applying the initial property values. This is problematic for default functions.

Looks like easy fix: just skip applying defaults when creating the empty object, and let init() apply defaults.

Still one failing test case though that I need to fix, thought I had fixed it but guess not.

Examples

Copy link
Collaborator

@AbdelrahmanHafez AbdelrahmanHafez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Default functions and incorrect "this" document
2 participants