Closed
Description
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:
- Let
F
be thethis
value. - Let
V
be the first argument we were passed. - If
F
is not an object, returnfalse
. - If
F
is not an interface object, returnfalse
(or delegate toOrdinaryHasInstance
?) - If
V
is not an object, returnfalse
. - If
V
is an object that implements the interface for whichF
is the interface object (defined in terms of brands, whatever), returntrue
. - 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...