Rick Waldron (2014-06-11T20:13:48.000Z)
On Wed, Jun 11, 2014 at 4:04 PM, Allen Wirfs-Brock <allen at wirfs-brock.com>
wrote:

>
> On Jun 11, 2014, at 11:59 AM, Rick Waldron wrote:
>
>
>
>
> On Wed, Jun 11, 2014 at 1:37 PM, Domenic Denicola <
> domenic at domenicdenicola.com> wrote:
>
>> It's also deceptive: it makes you think `Array.of` and `Array.from` are
>> functions, when in reality they are definitely methods.
>>
>
> Yes, you're right.
>
>
> What about Array subclasses? `from` and `of` are "inherited" when Array is
> subclassed, so these:
>
> 22.1.2.3 4 & 5 (
> http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.of)
> 22.1.2.1 8.a & 8.b (
> http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.from)
> 22.1.2.1 13 & 14
>
> Which are are how `from` and `of` determine what to construct, will be
> replaced with a single step, being one of:
>
> Let A be the result of calling the [[Construct]] internal method of C with
> an empty argument list.
> Let A be the result of calling the [[Construct]] internal method of C with
> an argument list containing the single item len.
>
> But surely this step will also have to be guarded by IsCallable(this),
> which that means this:
>
> If IsConstructor(C) is true, then
>   Let A be the result of calling the [[Construct]] internal method of C
> with an empty argument list.
> Else,
>   Let A be ArrayCreate(0).
>
> Becomes:
>
> If IsCallable(C) is true, then
>
>
> that's not an adequate guard, be an object can be callable but not have a
> [[Construct]] internal method so the next step not be valid
>

I wasn't recommending this, I was illustrating that removing IsConstructor
benefits no one and hurts the overall programming experience. This one only
one layer of the illustration. Either way, I've given up on presenting
reasons why the IsConstructor guard was useful. It's too bad that no one
who wanted those aliasing options bothered to speak up.

Rick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140611/890933c5/attachment.html>
domenic at domenicdenicola.com (2014-06-20T19:29:44.330Z)
On Wed, Jun 11, 2014 at 4:04 PM, Allen Wirfs-Brock <allen at wirfs-brock.com> wrote:

> that's not an adequate guard, be an object can be callable but not have a
> [[Construct]] internal method so the next step not be valid

I wasn't recommending this, I was illustrating that removing IsConstructor
benefits no one and hurts the overall programming experience. This one only
one layer of the illustration. Either way, I've given up on presenting
reasons why the IsConstructor guard was useful. It's too bad that no one
who wanted those aliasing options bothered to speak up.