So I ran into this over the weekend while writing unit tests. From LzNode.as:

//------------------------------------------------------------------------------ 
// Searches subnodes for the given value of the given property 
// @param String prop: The attribute name to search for 
// @param any val: The value of the attribute. 
// @return LzNode: The a pointer to subnode with the given property 
//------------------------------------------------------------------------------ 
LzNode.prototype.searchSubnodes = function ( prop , val) { 
    //NB -- uses subviews not subnodes 
    var nextS = this.subviews.concat(); 

    [some other code that is an exact copy of LzView.searchSubviews]

I've filed a bug (LPP-1068) on this, with a sub-task to minimally address the documentation issue by updating the RefGuide. The right fix would be to change "subviews" to "subnodes" in the first line of code (and remove the NB comment), but that's likely to break code that assumes searchSubnodes behaves the same as searchSubviews. I have no idea how much code like that is out in the wild. There is some in our sources -- 8 places in our .lzx code that I see, and in the implementation of LzNode.determinePlacement. (By the way, isn't it weird that LzNode.determinePlacement relies on an attribute (subviews) that is only declared in a subclass, LzView?)

Thoughts?

jim
_______________________________________________
Laszlo-dev mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-dev

Reply via email to