Relationship between globals, Realms, and global environment records

Allen Wirfs-Brock allen at
Tue Nov 25 08:45:59 PST 2014

On Nov 25, 2014, at 8:25 AM, Boris Zbarsky wrote:

> On 11/25/14, 11:11 AM, Allen Wirfs-Brock wrote:
>> regarding
>>    var document =;
>> perhaps you can model this by saying that every Document object is created in a new Realm.
> Can you explain what problem you're trying to solve here, precisely? I'm not sure there's even a problem here, fwiw.  But creating every Document object in a new Realm is not obviously web-compatible (or more precisely would require some pretty major gyrations around the transition from the initial about:blank to a same-origin document to make it web-compatible: the entire state of the Realm at the point of transition would need to be copied over to the new Realm.  It's simpler to just use the same Realm).

I'm simply trying to understand what what is meant when HTML talks about changing the global object/realm/etc. and how that can be reconciled with a rational language semantics such as exhibited by the function I presented.


More information about the es-discuss mailing list