-
Notifications
You must be signed in to change notification settings - Fork 181
Closed
Labels
⌛⌛ duration:mediumShouldn't be too long to fixShouldn't be too long to fix☕☕☕ difficulty:hardExcruciatingExcruciating
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
Fbe thethisvalue. - Let
Vbe the first argument we were passed. - If
Fis not an object, returnfalse. - If
Fis not an interface object, returnfalse(or delegate toOrdinaryHasInstance?) - If
Vis not an object, returnfalse. - If
Vis an object that implements the interface for whichFis 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...
Metadata
Metadata
Assignees
Labels
⌛⌛ duration:mediumShouldn't be too long to fixShouldn't be too long to fix☕☕☕ difficulty:hardExcruciatingExcruciating