Rick Waldron (2014-06-11T20:06:58.000Z)
On Wed, Jun 11, 2014 at 3:27 PM, Domenic Denicola <
domenic at domenicdenicola.com> wrote:

> From: Rick Waldron <waldron.rick at gmail.com>
>
> > Or maybe that's not necessary? Is it preferable to just throw when
> someone writes any of these:
>
> I think it is indeed preferable, as would happen when using any other
> method (`this`-dependent function) without a `this`.
>
> > (Note that `Array.isArray` doesn't cease to work correctly when aliased)
>
> `Array.isArray` is not a method, but a function; it does not change
> behavior depending on its `this` value.
>

I wasn't arguing that it was or wasn't, but I guess my point wasn't clear,
so that's my mistake: most web developers won't know or care about the
difference.


>
>
>
> > With the IsConstructor or IsCallable guard, these "just work"; without
> any guard, they'll throw TypeError exceptions: "object is not a function"
> or "undefined is not a function" (in strict mode). Neither of these errors
> are very obvious.
>
> I disagree that this is not obvious. This is the same error you always get
> when aliasing a method and trying to use it as a function.


> > Of course this  can all be fixed with .bind() or a "bind" operator, but
> it just seems unfortunate to throw out something that's not harming the
> spec in favor something that might be problematic in end user code.
>
> This is a bit of a slippery-slope argument; the end result is that every
> method should have a default `this` value that it's "soft-bound" to, in
> order to coddle the users who might get confused.
>


Fair enough, I give up, it's all yours to behead.

Rick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140611/45759dac/attachment-0001.html>
domenic at domenicdenicola.com (2014-06-20T19:29:14.567Z)
On Wed, Jun 11, 2014 at 3:27 PM, Domenic Denicola <domenic at domenicdenicola.com> wrote:

> `Array.isArray` is not a method, but a function; it does not change
> behavior depending on its `this` value.

I wasn't arguing that it was or wasn't, but I guess my point wasn't clear,
so that's my mistake: most web developers won't know or care about the
difference.

> This is a bit of a slippery-slope argument; the end result is that every
> method should have a default `this` value that it's "soft-bound" to, in
> order to coddle the users who might get confused.


Fair enough, I give up, it's all yours to behead.