Solving the "how do I tell whether I have an HTML element?" (or image element, or whatever) problem

Brandon Benvie brandon at
Wed Jan 16 15:10:33 PST 2013

Indeed, this is described by @@hasInstance in recent drafts of the ES6
spec. It's a property of Function.prototype, and adding custom
functionality for it simply requires access to the @@hasInstance symbol in
order to the set your own custom functionality.

On Wed, Jan 16, 2013 at 2:13 PM, Boris Zbarsky <bzbarsky at> wrote:

> On 12/31/12 11:33 PM, Boris Zbarsky wrote:
>> 1)  Hack instanceof as Gecko has in the past.  This is actually a bit of
>> a pain to implement even in Gecko, without changes to SpiderMonkey,
>> because function objects can't have the magic behavior the RHS needs
>> above in SpiderMonkey at the moment.
> We have decided to go this route in Gecko, I believe, given that Allen
> says this will be describable in ES6.
> In the short term that means that our WebIDL interface objects will
> probably not be function objects but reasonable facsimiles.  In the longer
> term we'll probably add a way to have functions have custom instanceof
> behavior to SpiderMonkey.
> The next step is presumably getting WebIDL changed accordingly.  With that
> in mind, I would welcome one single representative of another browser or
> browser engine commenting here... ;)
> -Boris
> ______________________________**_________________
> es-discuss mailing list
> es-discuss at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list