W3C home > Mailing lists > Public > public-script-coord@w3.org > July to September 2014

Would it make sense for Web IDL [[Call]] to do the current execution context munging that ES6 functions' default [[Call]] does?

From: Boris Zbarsky <bzbarsky@mit.edu>
Date: Thu, 28 Aug 2014 12:43:34 -0400
Message-ID: <53FF5C36.2030509@mit.edu>
To: "public-script-coord@w3.org" <public-script-coord@w3.org>
Right now ES6 seems to have the following abstract operations defined:

1)  GetGlobalObject.  This will get the global of the current execution 
context.

2)  GetFunctionRealm.  This takes a function object and returns its realm.

That's it.

So if a Web IDL function wants to get at its own global it has to call 
GetFunctionRealm on itself and then extract the global from the Realm. 
There is no abstract operation for this last bit; it'd just have to poke 
at internal slots.

If Web IDL functions munged the current execution context, we could just 
GetGlobalObject() to do the right thing in spec algorithms as needed.

Furthermore, I suspect that suspending the current execution context on 
function entry is in fact needed to properly interop with some ES 
features...

-Boris
Received on Thursday, 28 August 2014 16:44:02 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:22 UTC