That makes sense, to pass the object down instead of the dependencies list.
There's only a couple of callers to applyConstraint right now, but one of
them is this one caller in LaszloView that makes it's own dependencies list:

function setPosConstraint ( v , f , widthorheight ){
    var d = [ v , widthorheight  , this , widthorheight ];
    this.applyConstraint( widthorheight == "width" ? "x" : "y" , f , d );
}


How do think I should handle that? I could make an object and put a
.dependencies on it and pass that I guess.

On 10/16/07, P T Withington <[EMAIL PROTECTED]> wrote:
>
> In fact, wouldn't it make more sense to move all the logic about
> dependencies inside applyConstraint so it will be handled correctly
> in one place and update all the callers?  I see no reason to have the
> callers compute the dependencies out of line, you just need to pass
> the target (this) down to applyConstraint.
>
> On 2007-10-16, at 16:40 EDT, P T Withington wrote:
>
> > Not approved.
> >
> > 1) This code should be modeled on the known-working code in LzNode:
> >
> >>         if (rp instanceof Function && ('dependencies' in rp)) {
> >>             this.applyConstraint( p , rp , rp.dependencies.call
> >> (this) );
> >>         }
> >
> > rather than creating the mystery `_t` attribute.
> >
> > 2) There seems to be another branch of the code that replicates the
> > same bug which should also be rewritten in modern style.
> >
> > 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.
> >
> > On 2007-10-16, at 15:24 EDT, Henry Minsky wrote:
> >
> >> Change 20071016-hqm-4 by [EMAIL PROTECTED] on 2007-10-16
> >> 15:19:46 EDT
> >>     in /cygdrive/c/users/hqm/openlaszlo/trunk
> >>     for http://svn.openlaszlo.org/openlaszlo/trunk
> >>
> >> Summary: fix for DHTML replication bug
> >>
> >> New Features:
> >>
> >> Bugs Fixed: LPP-4893
> >>
> >> Technical Reviewer: andre
> >> QA Reviewer: ptw
> >> Doc Reviewer:
> >>
> >> Documentation:
> >>
> >> check for null dependencies function before calling it
> >>
> >> Release Notes:
> >>
> >> Details:
> >>
> >>
> >> Tests:
> >>
> >> test case from bug, smokecheck, amazon app
> >>
> >> Files:
> >> M      WEB-INF/lps/lfc/data/LzReplicationManager.lzs
> >>
> >> Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20071016-
> >> hqm-4.tar
> >>
> >>
> >> --
> >> Henry Minsky
> >> Software Architect
> >> [EMAIL PROTECTED]
> >
>
>


-- 
Henry Minsky
Software Architect
[EMAIL PROTECTED]

Reply via email to