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

Re: Detecting the "type" of a DOM object

From: Garrett Smith <dhtmlkitchen@gmail.com>
Date: Thu, 7 Jun 2012 21:47:05 +0000
Message-ID: <CABZUbM2RuwK19JCD1sSTS4SiuQApqi1=Jw2uK2RuGWyomOL7Aw@mail.gmail.com>
To: Boris Zbarsky <bzbarsky@mit.edu>
Cc: "public-script-coord@w3.org" <public-script-coord@w3.org>
On 6/6/12, Boris Zbarsky <bzbarsky@mit.edu> wrote:
> There's a common problem where someone has an object and they would like
> to tell whether it's a Node (or an Array or a Date or whatever).  Right

It's only a problem if you do that and there's no need to do it anyway.

The general consensus for years over at c.l.js, based on many long and
sometimes heated discussions (usually involving jQuery fans) is that
the desire to know the inheritance structure of an object is rooted
primarily in the use of overloading strategies. The problems with
overloading are more noticeable for methods that are broad in what
they claim to accept, such as any of host object, native ES objects,
user defined object, primitive value. That was a very big want among
the developers of Jquery, particularly since it failed miserably in
IE.
-- 
Garrett
Twitter: @xkit
personx.tumblr.com
Received on Thursday, 7 June 2012 21:47:34 UTC

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