-
Notifications
You must be signed in to change notification settings - Fork 17
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
Relationship between spawned realm objects and their parent realm object #26
Comments
update1: this was updated to reflect some of the consensus from yesterday's meeting. We still need answer for q2, q3, and q4. |
q4 is clearest. The |
q3 yes. In general spawned realms should be full fledged realms that differ in how they are constructed, and therefore in what initial state they start with. Once initialized, ideally, they function just as any other realm object would. Unless there's a reason not to of course. Does such uniformity create any problems? |
q2 not currently AFAIK. The frozen realm proposal does not itself need to provide any such means. If the realm API evolves into something that is sufficiently expressive that the answer to q2 is yes, that would probably be good. But I don't think it affects the frozen realm proposal. |
q2 is sound good to me, we can eventually introduce an API to create spawn realms. The only issue is that this is related to q3 in the sense that the hooks are extracted from the this during construction, and allocated into the Realm Record, this will make impossible for the current spec to provide custom hooks for spawned realms because they have a very peculiar construction process. |
As for q4, if you have access to the spawned realm, you can always do:
which is equivalent to calling |
Based on the new realm API, these are some of the questions:
Question 1: getPrototypeOf
Question 2: constructor
Can spawned realms be created in user-land using an API other than
parentRealm.spawn()
?Question 3: hooks
Can spawned realms define custom hooks for indirect eval and direct eval?
Question 4: init
Should
init()
method attempt to set intrinsics (from parent realm) into fresh global? or should it attempt to set intrinsics in the parent realm's global object? e.g.:Question 5: eval method
The text was updated successfully, but these errors were encountered: