Reflect.type

Thaddee Tyl thaddee.tyl at gmail.com
Mon Jun 8 15:05:46 UTC 2015


On Mon, Jun 8, 2015 at 4:38 PM, Nick Krempel <ndkrempel at google.com> wrote:
> On 8 June 2015 at 15:05, Thaddee Tyl <thaddee.tyl at gmail.com> wrote:
>> Ah! Good. I expected it to fail just like this:
>>
>> ```js
>> function Thing(){}
>> function SubThing(){}
>> SubThing.prototype = Object.create(Thing)  // BUG:
>> Object.create(Thing.prototype) intended?
>> SubThing.prototype.constructor = Thing
>> Object(new SubThing) instanceof Thing  // Then this would be true.
>> ```
> That only fails because of the probable bug on the third line.

You're right. Sorry.

So, what is left? Is Reflect.type useful? Adding `Undefined` and
`Null` as types for which `Object(null) instanceof Null` etc. seems
unnecessary, since we'd use triple-equal comparison.


More information about the es-discuss mailing list