W3C home > Mailing lists > Public > www-dom@w3.org > July to September 2001

Re: minor bug in DOM Level 2 Traversal spec

From: David Flanagan <david@oreilly.com>
Date: Fri, 17 Aug 2001 08:51:56 -0700
Message-Id: <200108171551.IAA00854@oxymoron.oreilly.com>
To: keshlam@us.ibm.com
CC: www-dom@w3.org

> Beware assumptions. We never stated the language, as far as I can tell, and
> note that what Java calls getFirstChild() _is_ just called firstChild() in
> the ECMAScript bindings, due to different local naming conventions.

In ECMAScript (JavaScript), it would simply be firstChild, with no
parentheses.

> I honestly dont't know whether this code would be acceptable ECMAScript
> either -- I can read that language but haven't written it.

No, it wouldn't be acceptable ECMAScript either, because in that binding
firstChild and nextSibling are properties, not methods.  Also, the code
includes variable declarations using Java syntax, not JavaScript
syntax. 

The code isn't valid Java or JavaScript, and I think it is fair to say
that it would not be valid in any binding.  The firstChild and
nextSibling attributes in the IDL either need to be mapped to
properties, or to methods.  But, if they are mapped to methods, they
really need to have their names changed to indicate whether they are
getter or setter methods.  So I think these should be getFirstChild()
and getNextSibling()

       David
Received on Friday, 17 August 2001 12:46:01 GMT

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