Skip to content

[Stage 3] behavior of global object #411

@mhofman

Description

@mhofman

Originally this proposal created a regular object for the global and provided a host hook to add configurable properties and change the prototype according to the APIs the host needed to expose.

#392 attempted to change that, to which I objected. The spirit of the changes in that PR were subsequently absorbed in other PRs and #392 was closed.

To satisfy virtualization use cases, the global object in a ShadowRealm must remain effectively fully configurable and with a behavior observably similar to a regular object. There is no way to specify such constraints on a host besides having the 262 spec create the global object. That means in InitializeHostDefinedRealm, step 12.a must be prevented for the ShadowRealm global, and the Else path in 12.b must be used.

If the host requires use of an exotic object to serve as realm's global object

To clarify, while the host must not be allowed to observably use an exotic object, that requirement does not prevent an implementation to actually use an exotic object as global object, as long as the exotic behavior is observably indistinguishable from a regular object behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions