[heycam/webidl] Should probably spec a hasInstance for DOM interface objects (#129)

Right now we have a [[HasInstance]] thing at http://heycam.github.io/webidl/#es-interface-hasinstance but that's gone in ES6.

Proposed prose with similar semantics is something like:

1. Let `F` be the `this` value.
2. Let `V` be the first argument we were passed.
3. If `F` is not an object, return `false`.
4. If `F` is not an interface object, return `false` (or delegate to `OrdinaryHasInstance`?)
5. If `V` is not an object, return `false`.
6. If `V` is an object that implements the interface for which `F` is  the interface object (defined in terms of brands, whatever), return `true`.
7. Return `OrdinaryHasInstance(F, V)`.

@domenic, thoughts?

An open question is whether `Node[Symbol.hasInstance] == Element[Symbol.hasInstance]` should test true or false.  We could go either way, given the above prose, since they would implement the same algorithm...

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/heycam/webidl/issues/129

Received on Tuesday, 7 June 2016 15:54:15 UTC