Function#bind [[HasInstance]] question.

John-David Dalton john.david.dalton at gmail.com
Tue Aug 16 10:34:24 PDT 2011


Thanks Luke,

Your explanation made it "click".
I was going to file a bug report, but found it already existed (from
2010 eeeek).
http://code.google.com/p/v8/issues/detail?id=793

-JDD

On Tue, Aug 16, 2011 at 12:12 PM, Luke Hoban <lukeh at microsoft.com> wrote:
> My interpretation of these spec sections:
>
> (new bound) instanceof bound
> => (new Bar()) instanceof bound // bind's Construct defers to the targetFunction and ignores bound thisValue
> => bound.[[HasInstance]](new Bar()) // meaning of instanceof
> => Bar.[[HasInstance]](new Bar()) // bind's HasInstance defers to the targetFunction
> => true // normal HasInstance
>
> Similarly for 'new bound instanceof Bar'.    IE and Firefox both appear to agree with this result.
>
> Luke


More information about the es-discuss mailing list