Hm, if I read the code correctly, then there is another difference, 
namely that isChildNode also returns true if the second node is not the 
direct parent, but also for grandparents and any ancestors. So it should 
be actually renamed to something like isDescendant or isAncestor.

You can merge the functions by using an additional flag (e.g. 
direct=true), but it's probably easier to have two separate functions. 
However, they certainly need better names & documentation.

-- Christoph

Per Cederberg schrieb:
 > Noone has opinions on this?
 >
 > Cheers,
 >
 > /Per
 >
 > On Wed, Oct 8, 2008 at 3:51 PM, Per Cederberg <[EMAIL PROTECTED]> 
wrote:
 >> The two functions MochiKit.DOM.isChildNode and isParent have both been
 >> added in version 1.4 of MochiKit (not yet stable). But they are
 >> virtually identical (except for a few bugs I'm in fixing right now).
 >> The only difference, according to the API docs, as far as I can tell
 >> is:
 >>
 >> isChildNode(node, node) --> true
 >> isParent(node, node) --> false
 >>
 >> Is it not pointless to keep both functions around? Since isChildNode()
 >> is more tested (and probably more used), I'd suggest removing
 >> isParent() from the API before the 1.4 release. Possibly, in order to
 >> simplify the transition, we could just alias isParent to isChildNode
 >> (and remove the API doc specification so that noone will use it from
 >> now on).
 >>
 >> Opinions?
 >>
 >> Cheers,
 >>
 >> /Per

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"MochiKit" group.
To post to this group, send email to mochikit@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/mochikit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to