Should host objects be able to have [[Class]] "Function", "Array" etc.?

Maciej Stachowiak mjs at apple.com
Tue Nov 18 03:32:54 PST 2008


On Nov 17, 2008, at 9:24 PM, David-Sarah Hopwood wrote:

> Maciej Stachowiak wrote:
>> On Nov 14, 2008, at 4:48 PM, David-Sarah Hopwood wrote:
>>>
>>> Should host objects be required not to have [[Class]] "Function"?
>>
>> No, I do not think this is a sounds requirement. All native  
>> functions in
>> the DOM are host objects, and I think it would be wrong to disallow  
>> them
>> to have [[Class]] "Function", or to prevent any Function.prototype
>> methods from working on them.
>>
>> I would find it acceptable to require any host object that has  
>> [[Class]]
>> "Function" to implement the [[Call]] internal property and to have a
>> read-only non-deletable property named "length" which has a numeric  
>> value.
>
> The "prototype" property is also used. I haven't checked what is  
> assumed
> about it.

Host functions in the DOM do not generally have a "prototype"  
property, because they generally cannot be invoked as constructors.  
However, I think all functions that operate on functions should accept  
these native functions. I think this is best dealt with by making the  
bind algorithm more generic.

Regards,
Maciej



More information about the Es-discuss mailing list