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

Consider storing the associated "parent" Realm in an internal slot #285

Open
littledan opened this issue Nov 11, 2020 · 5 comments
Open

Comments

@littledan
Copy link
Member

In the HTML integration patch for Realms, HTML keeps track of the parent Realm of each synthetic Realm created in this API as part of a record stored in its [[HostDefined]] field. The parent Realm is used to key off of for various behaviors at the HTML level.

While this mechanism can be defined accurately at the HTML level, it is likely meaningful in other environments as well (cc @jasnell who has been thinking about this for Node.js). So, we should consider defining the parent Realm in a field of the record for synthetic Realms, to facilitate this.

Thanks to @annevk for pointing out this issue.

This is a minor editorial/layering issue that does not block Stage 3 and can be iterated on after it.

@caridy
Copy link
Collaborator

caridy commented Nov 11, 2020

sounds good to me! I decided to used [[HostDefined]] because I wasn't sure if such relationship was important for others, but if it is, we should add the new internal slot, and formalize this relationship in the spec itself.

@leobalter
Copy link
Member

@littledan can you update on this? Thanks!

@littledan
Copy link
Member Author

My current focus is on completing an initial description of the HTML embedding, which works fine without this editorial change, as I explained. With the editorial variant described in #whatwg/html#6855, the whole "synthetic realm settings object" concept basically exists just to point to the parent realm. So, this change might be a nice cleanup, but it is not urgent.

@caridy
Copy link
Collaborator

caridy commented Dec 2, 2022

I believe this is now resolved.

@caridy caridy closed this as completed Dec 2, 2022
@annevk
Copy link
Member

annevk commented Dec 2, 2022

Could you explain how it's resolved? As far as I can tell the HTML PR still uses [[HostDefined]] for this.

@annevk annevk reopened this Dec 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants