Re: Detecting the "type" of a DOM object

2012/6/22 David Bruant <bruant.d@gmail.com>

> For the record, rationale for not including a trap for instanceof was
> described here: http://wiki.ecmascript.org/**doku.php?id=harmony:proxies#*
> *interaction_with_instanceof<http://wiki.ecmascript.org/doku.php?id=harmony:proxies#interaction_with_instanceof>


We've gone through this in detail before. There even was a strawman, but it
got deferred, see <
http://wiki.ecmascript.org/doku.php?id=strawman:proxy_instanceof>

>From that strawman's "feedback" section:

"TC39 November 2010 meeting: after a meeting with the Web IDL editors,
agreed that Web IDL should not expose the multiple inheritance. Hence, a
custom [[HasInstance]] would not be necessary to wrap these host objects.

There may be other use cases for a custom [[HasInstance]] (outside of Web
IDL), but until such cases are identified we agreed not to pursue this
strawman in the interest of not further complicating the Proxy API."

I don't think the new direct proxies API impacts this strawman, so
technically I see no reason why proxies can't have a [[HasInstance]] trap
if needed.

Cheers,
Tom

Received on Friday, 22 June 2012 15:15:31 UTC