W3C home > Mailing lists > Public > www-dom@w3.org > April to June 2001

Re: DOM 3 Core: Overlap with JAXP, Document order of attributes, getChildElementsByTagName, Exceptions

From: Thomas Much <thomas@snailshell.de>
Date: Wed, 16 May 2001 16:58:55 +0200
To: <www-dom@w3.org>
Message-ID: <B72861EB.417B%thomas@snailshell.de>
Hi,

> if( err instanceof DOMException ){

A problem with the W3C recommendation and its ECMAScript binding is that it
does not require DOMException (and many other interfaces) to be a
constructor AFAIK.

If an ECMAScript builtin object is no constructor, it is most likely that
its type is not visible to scripts, i.e. "DOMException" is no valid type and
the code line above fails.

If I run this little JS script on my Mac

  var exc = new Object();

  if (exc instanceof DOMException)
  {
      // do something
  }

MSIE5, Opera5, Netscape6 and Mozilla 0.9 fail to execute it (I have not
checked how Windows browsers handle this script). Of all the browsers on my
hard disk only iCab reveals the type "DOMException".

Maybe the W3C-DOM ECMAScript binding should explicitely state that interface
types should be visible to scripts? In ECMAScript you do not need them for
casting, but for type checking.

bye, Thomas

-- 
http://www.snailshell.de/inscript/
http://www.icab.de
Received on Wednesday, 16 May 2001 10:59:06 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:48 GMT