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

Mark S. Miller erights at
Tue Nov 18 11:00:39 PST 2008

On Tue, Nov 18, 2008 at 3:32 AM, Maciej Stachowiak <mjs at> wrote:

> 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.

More generic than the one in the Kona draft? How? As written, it will curry
anything with a [[Call]] property. It conditions whether to use the
'prototype' and 'length' properties of the original based on whether the
original's [[Class]] is "Function". And it will curry the original's
[[Construct]] property only if the original has a [[Construct]] property. I
had hoped we could agree to make it less generic -- all these conditionals
are troublesome. But how would you make it more generic?

I also don't see a problem with David-Sarah's suggestion of forbidding host
objects from having [[Class]] "Function". Most places in the spec care only
about whether something is callable (has a [[Call]] property), not whether
it has [[Class]] "Function".

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Es-discuss mailing list