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

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 UTC