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

Editorial: Create the realm execution context slightly later #3497

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -11789,11 +11789,6 @@ <h1>InitializeHostDefinedRealm ( ): either a normal completion containing ~unuse
1. Set _realm_.[[GlobalObject]] to *undefined*.
1. Set _realm_.[[GlobalEnv]] to *undefined*.
1. Set _realm_.[[TemplateMap]] to a new empty List.
1. Let _newContext_ be a new execution context.
1. Set the Function of _newContext_ to *null*.
1. Set the Realm of _newContext_ to _realm_.
1. Set the ScriptOrModule of _newContext_ to *null*.
1. Push _newContext_ onto the execution context stack; _newContext_ is now the running execution context.
1. If the host requires use of an exotic object to serve as _realm_'s global object, then
1. Let _global_ be such an object created in a host-defined manner.
1. Else,
Expand All @@ -11804,6 +11799,11 @@ <h1>InitializeHostDefinedRealm ( ): either a normal completion containing ~unuse
1. Let _thisValue_ be _global_.
1. Set _realm_.[[GlobalObject]] to _global_.
1. Set _realm_.[[GlobalEnv]] to NewGlobalEnvironment(_global_, _thisValue_).
1. Let _newContext_ be a new execution context.
1. Set the Function of _newContext_ to *null*.
1. Set the Realm of _newContext_ to _realm_.
1. Set the ScriptOrModule of _newContext_ to *null*.
1. Push _newContext_ onto the execution context stack; _newContext_ is now the running execution context.
1. Perform ? SetDefaultGlobalBindings(_realm_).
1. Create any host-defined global object properties on _global_.
Comment on lines 11807 to 11808
Copy link
Member

Choose a reason for hiding this comment

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

Is the only reason we can't also move these lines up because SetDefaultGlobalBindings might throw? If so, should we (normatively) reconsider whether those property definitions should be permitted to throw?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Is the only reason we can't also move these lines up because SetDefaultGlobalBindings might throw?

Well, the only other possible reason would be that those remaining steps need the realm EC to exist (and maybe that it be on the EC stack). That isn't the case if the global object is ordinary, but if it's a host-defined exotic object, then I suppose its relevant internal methods could be specified to access the realm EC.

1. Return ~unused~.
Expand Down
Loading