Ok, but you still need to fix the other place in the replicator where it is unconditionally trying to compute dependencies. As I read your patch you only fixed one of two places.

And, lets file a bug to improve applyConstraint to calculate its own dependencies (if they are not passed). That way you can leave the old explicit calculations you found, but in the case where they are just coming from the constraint dependency you can centralize it in one place (and eliminate all this redundant code).

On 2007-10-17, at 08:07 EDT, Henry Minsky wrote:

Oh, I did that wrong in the patch, but Andre pointed that out , he
suggested this code instead

this.applyConstraint( 'xpath', cons, this._t != null ? this._t() : [] );



On 10/16/07, P T Withington <[EMAIL PROTECTED]> wrote:
On 2007-10-16, at 17:23 EDT, Henry Minsky wrote:


3) What about the case of a $once constraint?  Will it be handled
correctly? In LzNode when there are no dependencies, the constraint
function is still called at least once.  I don't see in this code
where that is handled.



Here's where the $once function gets called if no dependencies, in
__LZresolveRefs, before the loop that calls applyConstraints, there
is a
loop that checks a constraint  to see if there are no dependencies,
and just
calls it right there if there aren't any.


        } else if ( !('dependencies' in rp && rp.dependencies) ){
            if (rp instanceof Function) {
              rp.call(this);
            }
        }

Yeah, that is for normal nodes, but what about this funny replication
case which is duplicating some of the node apply constraint logic,
but does not seem to deal with the once case?



--
Henry Minsky
Software Architect
[EMAIL PROTECTED]

Reply via email to