> If instanceof(Attr) returns true, it'd better be an Attr node, > or your users will get very confused. I"m completely undecided as to whether that should be considered a bug or not. It depends on an assumption about whether or not an API is a contract guaranteeing that behavior will be supported, or stating how that behavior behaves if this instance supports it, and I think there are legitimate design spaces for both. Since the DOM doesn't make a statement either way, I wouldn't count on instanceof() to distinguish node types, and I generally advise users to avoid doing so, since there's a good alternative (nodeType) which _is_ promised to Do The Right Thing. ______________________________________ Joe Kesselman / IBM ResearchReceived on Tuesday, 5 October 1999 11:26:58 GMT
This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 October 2009 08:24:51 GMT