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: Return created EC from InitializeHostDefinedRealm #3274

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on Apr 9, 2024

  1. Editorial: Return created EC from InitializeHostDefinedRealm

    This AO is not being used in ECMA-262 directly, but from real-world
    experience implementing & using is as-is I can say that having to pull
    the Realm out of the running execution context is somewhat awkward.
    
    This change is not backwards compatible with how the HTML spec uses the
    AO, but will allow simplifying the following:
    
    1. Perform InitializeHostDefinedRealm() with the provided customizations
       for creating the global object and the global this binding.
    2. Let realm execution context be the running JavaScript execution
       context.
    3. Remove realm execution context from the JavaScript execution context
       stack.
    4. Let realm be realm execution context's Realm component.
    
    to
    
    1. Let realm execution context be InitializeHostDefinedRealm() with the
       provided customizations for creating the global object and the global
       this binding.
    2. Let realm be realm execution context's Realm component.
    
    (https://html.spec.whatwg.org/#creating-a-new-javascript-realm)
    
    For hosts that don't have HTML's requirement of removing the running
    execution context, it becomes a simple:
    
    1. Let executionContext be InitializeHostDefinedRealm().
    2. Let realm be executionContext.[[Realm]].
    linusg committed Apr 9, 2024
    Configuration menu
    Copy the full SHA
    668b11d View commit details
    Browse the repository at this point in the history