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>

> 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

Received on Wednesday, 16 May 2001 10:59:06 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:08 UTC