[Laszlo-dev] For Review: Change 20090421-ptw-J Summary: Make constraints idempotent

P T Withington ptw at pobox.com
Tue Apr 21 14:35:14 PDT 2009


Change 20090421-ptw-J by ptw at dueling-banjos.home on 2009-04-21  
16:17:33 EDT
     in /Users/ptw/OpenLaszlo/trunk-3
     for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: Make constraints idempotent

Bugs Fixed: LPP-8058  Constraints should short-circuit if the value  
would not change

Technical Reviewer: a.bargull at intensis.de (pending)
QA Reviewer: mdemmon (pending)

Release Notes:
     This change makes it an error to constrain an attribute to `void
     0` (undefined).

Details:
     LzNode: Ensure attributes with setters or constraints are created
     in the instance for JS1 runtimes (for implicit this), but have
     `void 0` as their value, not `null`, to ensure constraints are
     executed at least once.

     LzStyleAttrBinder, LzDataAttrBind, NodeModel: Add a test to
     $always, $path, and $style constraints that looks to see if the
     attribute being constrained already has the value that will be
     set.  If it does, don't set it again.  This should improve the
     performance of most applications because it will prevent pointless
     event cascades.  (Cf., LPP-7452 which required that `setAttribute`
     _not_ make this optimization.)

Tests:
     {smokecheck, component sampler, amazon, calendar} x {swf8, dhtml,
     swf9} x { , debug}

Files:
M      WEB-INF/lps/lfc/core/LzNode.lzs
M      WEB-INF/lps/lfc/core/LzStyleAttrBinder.lzs
M      WEB-INF/lps/lfc/data/LzDataAttrBind.lzs
M      WEB-INF/lps/server/src/org/openlaszlo/compiler/NodeModel.java


Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20090421-ptw-J.tar


More information about the Laszlo-dev mailing list