callable objects ?

David Bruant bruant.d at gmail.com
Wed Apr 18 10:33:31 PDT 2012


Le 18/04/2012 17:14, Brendan Eich a écrit :
> David Bruant wrote:
>>> Change 11.2.3 "Function Calls" to use @call not [[Call]], passing
>>> the /thisValue/ and /argList/ according to the
>>> Function.prototype.call convention: (thisValue, ...argList).
>> @call as own property only or is it inherited as well?
>
> I see no reason to require own.
After giving some more thoughts:

    function f(){
        return 12;
    }

    var o = Object.create(f);
    o();

Currently this throws a TypeError (o isn't a function). If the @call
property was inherited, the inherited @call would be called (and no
error would be thrown).
I don't know to what extent it matters, but it's worth noting there
would be this difference.

David


More information about the es-discuss mailing list