Relationship between globals, Realms, and global environment records

Allen Wirfs-Brock allen at
Mon Nov 24 16:51:40 PST 2014

On Nov 24, 2014, at 7:11 AM, Anne van Kesteren wrote:

> On Sat, Nov 22, 2014 at 10:42 PM, Boris Zbarsky <bzbarsky at> wrote:
>> On 11/22/14, 6:20 AM, Anne van Kesteren wrote:
>>> I thought these to be 1:1:1, but e.g. HTML defines the
>>> API
>>> which replaces the global object. It's not currently defined in
>>> excruciating detail, but I suspect it will be at some point since
>>> content depends on this working.
>>> Should that affect the Realm and global environment record?
>> Yes, imo.
> I filed to track
> this on the HTML side.

There is definite a 1:1:1 relationship between a global object, realmRec, global environment record.  And  ES views those relationships are immutable.  You can't just change the global object of a realmRec or give it a different global environment record after it has been initialized.

Note that the ES6 spec. defines InitializeFirstRealm [1] that define how the first Realm gets created.  Creating additional realms would have to perform a similar set of steps.

Subsequent to the ES6 spec. we will be defining a ES level Realm object and associated API that supports creation and initialization of additional realms. 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list