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

On Aug 28, 2014, at 11:31 AM, Boris Zbarsky wrote:

> On 8/28/14, 2:22 PM, Allen Wirfs-Brock wrote:
>>> I say mostly, because there _are_ some cases where Web IDL defines its own [[Call]].  Specifically, for constructors and legacycallers.  Is there a way those [[Call]] definitions could just have the steps of #sec-built-in-function-objects-call-thisargument-argumentslist performed without copy/pasting them?
>> 
>> That's fine.  You should be able to do whatever you need as part of the step 7 or 9 extension points.
> 
> Not quite, because at least the legacycaller case is not a Function object at all.  So it really does need to define a [[Call]] in its entirety.

Well, ES basically considers anything with a [[Call]] internal method to be a function object of one sort or another.  There really aren't any requirements or invariants imposed upon [[Call]].  The built-in function [[Call]] sets up the invariants that ensure that the "body" of the function can interact with the rest of the ES spec (including making callbacks into ES code).  


Allen

Received on Thursday, 28 August 2014 19:07:13 UTC