Andreas Rossberg (2015-01-19T10:58:27.000Z)
On 17 January 2015 at 19:14, Allen Wirfs-Brock <allen at wirfs-brock.com>
wrote:

> On Jan 17, 2015, at 9:53 AM, Domenic Denicola wrote:
> > On Jan 17, 2015, at 12:31, Allen Wirfs-Brock <allen at wirfs-brock.com>
> wrote:
> >>
> >> If the enclosing function is invoked as a call expression the value of
> `new.target` is null
> >
> > Just curious, why null instead of undefined?
>
> null is used to indicate no [[Prototype]], so it seem to me to be a better
> match for this situation.
>

Wouldn't the fact that null is a quasi-legal prototype strongly speak for
using undefined here? Otherwise, it seems you couldn't distinguish Call
invocations from Construct invocations with a prototype that has actually
been set to null (which I suppose is legal?).

(In terms of proper option/maybe types, this is yet another case of a None
vs Some(None) distinction.)

/Andreas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150119/c10d3ffc/attachment.html>
d at domenic.me (2015-01-28T19:33:36.261Z)
On 17 January 2015 at 19:14, Allen Wirfs-Brock <allen at wirfs-brock.com> wrote:

> null is used to indicate no [[Prototype]], so it seem to me to be a better
> match for this situation.

Wouldn't the fact that null is a quasi-legal prototype strongly speak for
using undefined here? Otherwise, it seems you couldn't distinguish Call
invocations from Construct invocations with a prototype that has actually
been set to null (which I suppose is legal?).

(In terms of proper option/maybe types, this is yet another case of a None
vs Some(None) distinction.)