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, 21 Jun 2012 16:24:11 -0700
Message-ID: <CABZUbM17uXtOvVWUBsaHZ1H+fEJEZdV90ALVMdq2CcDUmnQH4w@mail.gmail.com>
To: Cameron McCormack <cam@mcc.id.au>
Cc: Boris Zbarsky <bzbarsky@mit.edu>, "public-script-coord@w3.org" <public-script-coord@w3.org>
On 6/20/12, Cameron McCormack <cam@mcc.id.au> wrote:
> I think what I really want to write is:
>
>    if (n.is(Node))
>      ...
if(typeof n.is == "function" && n.is(Node))

But why? Do you include API version as a param? What does .is(Node)
say about what the object will do? This is getting to look a lot like
hasFeature.
-- 
Garrett
Twitter: @xkit
personx.tumblr.com
Received on Thursday, 21 June 2012 23:24:41 UTC

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