- From: Bjoern Hoehrmann <derhoermi@gmx.net>
- Date: Thu, 21 Jun 2012 06:03:03 +0200
- To: Boris Zbarsky <bzbarsky@MIT.EDU>
- Cc: "public-script-coord@w3.org" <public-script-coord@w3.org>
* Boris Zbarsky 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 >now, the way to do that is to use instanceof.... but with a huge caveat: >you have to pull the Node or Array or whatnot off the right global object. > >I was wondering whether it would make sense to expose, on DOM >constructor objects, a method that lets you test whether some other >object is of that type. Would you prefer such a method over having a proper `instanceof`-like operator on the language level that does not have the problem you cite? -- Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de Am Badedeich 7 · Telefon: +49(0)160/4415681 · http://www.bjoernsworld.de 25899 Dagebüll · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/
Received on Thursday, 21 June 2012 04:03:33 UTC