Allen Wirfs-Brock (2014-11-25T17:51:24.000Z)
On Nov 25, 2014, at 8:53 AM, Anne van Kesteren wrote:

> On Tue, Nov 25, 2014 at 5:45 PM, Allen Wirfs-Brock
> <allen at wirfs-brock.com> wrote:
>> I'm simply trying to understand what what is meant when HTML talks about changing the global object/realm/etc.
> 
> onload = function() {
>  self.x = "test"
>  console.log(self.x) // "test"
>  document.open("text/html")
>  console.log(self.x) // undefined
> }
> 

This example does tell me anything useful because 'self' is just a upbinding of the function.

Even if I assume that 'self' is a property of the global object, the example isn't interesting because the open function, if it was created in the same Realm as the function, would also have access to the same global object and could modify the object that is the value of its 'self' property.

Allen
d at domenic.me (2014-12-04T22:36:03.962Z)
On Nov 25, 2014, at 8:53 AM, Anne van Kesteren wrote:

> ```js
> onload = function() {
>  self.x = "test"
>  console.log(self.x) // "test"
>  document.open("text/html")
>  console.log(self.x) // undefined
> }
> ```

This example does tell me anything useful because 'self' is just a upbinding of the function.

Even if I assume that 'self' is a property of the global object, the example isn't interesting because the open function, if it was created in the same Realm as the function, would also have access to the same global object and could modify the object that is the value of its 'self' property.