Function#bind [[HasInstance]] question.

Dmitry A. Soshnikov dmitry.soshnikov at gmail.com
Tue Aug 16 09:38:05 PDT 2011


Once again (if the Twitter's discussion doesn't satisfy you):

Quick overview: https://gist.github.com/1149186
Detailed overview: 
http://dmitrysoshnikov.com/notes/note-1-ecmascript-bound-functions/

So the Firefox is correct saying `true`.

Dmitry.

On 16.08.2011 18:26, John-David Dalton wrote:
> Sorry about the last empty reply, GMail got ahead of itself :D
>
> So Chrome and Firefox disagree on their Function#bind implementation.
> http://es5.github.com/#x15.3.4.5.2
> http://es5.github.com/#x15.3.4.5.3
>
> ~~~ js
> function Bar() {
>    return 1;
> }
> var bound = Bar.bind({});
> new bound instanceof bound; // Firefox reports `true`, Chrome `false`
> (I think Chrome is right)
> new bound instance of Bar; // Firefox and Chrome report `true`
> ~~~
>
> The test262 doesn't appear to cover this case.
> What is the correct result of `new bound instance of bound;` and why?
>
> -JDD
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss



More information about the es-discuss mailing list