Re: Comments on the use of exceptions...

Mike Champion wrote:

> When looping over all child nodes, or all nodes returned by
> getElementsByTag name, we DO NOT want to force the user to call the size()
> [or whatever we ended up calling it; sorry I'm in a hurry ...] method to
> figure out how far to loop, because that might force the implementation to
> travel all the relevant Nodes and count them.

Not only that, but there is no assurance that the user's cached value
of NodeList.length is still correct, since new Nodes may have been
added to the tree.  So looping from 0 to length-1 is downright
incorrect.

-- 
John Cowan	http://www.ccil.org/~cowan		cowan@ccil.org
	You tollerday donsk?  N.  You tolkatiff scowegian?  Nn.
	You spigotty anglease?  Nnn.  You phonio saxo?  Nnnn.
		Clear all so!  'Tis a Jute.... (Finnegans Wake 16.5)

Received on Thursday, 20 August 1998 17:16:19 UTC