Claude Pache (2015-01-17T17:40:43.000Z)
> Le 17 janv. 2015 à 14:59, Frankie Bagnardi <f.bagnardi at gmail.com> a écrit :
> 
> I'm also expecting a lot of questions about 'what is this new.target thing in this code?', 'is new a variable?', 'where does it come from?', 'isn't new an operator?', etc.
> 
> if (this instanceof MyDate) ...
> 
> ... is clearer, but I guess it needs to be disallowed because of the other rules.

I don't find the "this instanceof MyDate" test clearer, but it may appear so because it is idiomatic. In fact, it is a somewhat indirect way to test what you want. (And it may be incorrect in some cases, which is a danger when you use indirect paths.)

—Claude
d at domenic.me (2015-01-28T19:29:01.360Z)
Le 17 janv. 2015 à 14:59, Frankie Bagnardi <f.bagnardi at gmail.com> a écrit :

> I'm also expecting a lot of questions about 'what is this new.target thing in this code?', 'is new a variable?', 'where does it come from?', 'isn't new an operator?', etc.
> 
> if (this instanceof MyDate) ...
> 
> ... is clearer, but I guess it needs to be disallowed because of the other rules.

I don't find the `this instanceof MyDate` test clearer, but it may appear so because it is idiomatic. In fact, it is a somewhat indirect way to test what you want. (And it may be incorrect in some cases, which is a danger when you use indirect paths.)