On Sat, Jun 6, 2015 at 6:23 PM, Jordan Harband <[email protected]> wrote:
> if `class SubThing extends Thing {}`, then `new SubThing instanceof Thing`
> would be true.
Ah! Good. I expected it to fail just like this:
```js
function Thing(){}
function SubThing(){}
SubThing.prototype = Object.create(Thing)
SubThing.prototype.constructor = Thing
Object(new SubThing) instanceof Thing // false
```
> Based on your isA examples, `Object(foo) instanceof bar` should be reliable
> within a single realm, and works everywhere, without the need for a new
> builtin method.
I can't think of a way to make something work across realms, so that's
indeed the best we have got.
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss