W3C home > Mailing lists > Public > public-script-coord@w3.org > April to June 2012

Re: Detecting the "type" of a DOM object

From: Brendan Eich <brendan@mozilla.org>
Date: Thu, 21 Jun 2012 08:05:30 -0700
Message-ID: <4FE3383A.4000106@mozilla.org>
To: Boris Zbarsky <bzbarsky@MIT.EDU>
CC: David Bruant <bruant.d@gmail.com>, public-script-coord@w3.org
Boris Zbarsky wrote:
>> So in Firefox, instanceof can be used with browser API (DOM +
>> localStorage + XHR + whatev's is built-in to the browser)
>
> Stop right there. ;)  XHR has been switched to WebIDL bindings already 
> (to ship in Firefox 14 in a few weeks), so you _can't_ use instanceof 
> there anymore.  Other things will be following.  Hence this thread....

Seems better to discuss and possibly revise WebIDL (and ES6, but see 
below -- it may be ready!) first, then change Gecko, but sounds like 
time is short to undo the change.

>> Of course. Then +1000 for changing how instanceof is defined in WebIDL
>> to adopt Gecko behavior!
>
> The point is WebIDL can't do that on its own: there is nothing in ES5 
> for it to hook into, as far as I know.  This needs coordination 
> between WebIDL and the ES spec. 

See [[NativeBrand]] in ES6 drafts including latest at

http://wiki.ecmascript.org/doku.php?id=harmony:specification_drafts

/be
Received on Thursday, 21 June 2012 15:06:07 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 May 2013 19:30:06 UTC