Apart from your change, I propose some improvements for LzNode:
(after comparing it to the 4.0.8 resp. 3.3.0 versions:
"http://svn.openlaszlo.org/openlaszlo/tags/4.0.8/WEB-INF/lps/lfc/core/LzNode.lzs";
"http://svn.openlaszlo.org/openlaszlo/tags/3.3.0/WEB-INF/lps/lfc/core/LzNode.as"; )

i)
That line is no longer necessary, because the "_instanceAttrs" property is set earlier. Can be simply removed (after running the standard tests, for sure :-) ).
// TODO: [2006-05-22 ptw] What is the purpose of this copy?
// construct or constructWithArgs destructively modify args?
var maskedargs = new LzInheritedHash(iargs);
ii)
"_instanceAttrs" should never become "undefined", so we're compliant to previous versions.
this._instanceAttrs = attrs;
change to:
this._instanceAttrs = attrs || {};

iii)
The same pattern used in "LzNode#_dbg_name()", is also used in "LzNode#construct(..)"
if (ip.determinePlacement == LzNode.prototype.determinePlacement) {
If that doesn't work for swf9 in "LzNode#_dbg_name()", it won't work here either.

---
iv)
Just spotted a wrong comment in "LzNode.mergeAttributes(..)":
// Just a normal value (or LzInitExpr), install it
dattrs[k] = attrk;
It will never be a LzInitExpr, because LzInitExpr is handled in the previous if-condition.


On 4/12/2008 12:32 AM, André Bargull wrote:
Right now I'm doing some additional tests, but I think that fix should be ok. So, approved from me!


On 4/12/2008 12:22 AM, P T Withington wrote:
I'm going to check this in ahead of André's review, to head off any additional bug reports (and it's pretty late for him). This fixes a major error in the commpiling of LZX classes and instances. I am pretty confident of this fix, because it passes lztest and lzunit.

André:  I still look forward to your usual thorough review!  :)

On 2008-04-11, at 18:09 EDT, Philip Romanik wrote:
Approved!

Change 20080411-ptw-r by <mailto:[EMAIL PROTECTED]>[EMAIL PROTECTED] on 2008-04-11
17:21:45 EDT
    in /Users/ptw/OpenLaszlo/ringding-clean
for <http://svn.openlaszlo.org/openlaszlo/trunk>http://svn.openlaszlo.org/openlaszlo/trunk

Summary: Restore instance attributes passed to construct methods

Bugs Fixed:
LPP-5732: 'Regression in Amazon @ 8592'
LPP-5762: 'InstanceAttrs without setters'

Technical Reviewer: <mailto:[EMAIL PROTECTED]>[EMAIL PROTECTED] (pending) QA Reviewer: <mailto:[EMAIL PROTECTED]>[EMAIL PROTECTED] (pending)

Details:
    LzNode:  I think I finally understand the dance between "class
    instance attributes" and "instance instance attributes".  The
    attributes put in a class by the tag compiler should be installed
    by the constructor, unless they have a setter (which the compiler
    could not know about).  But attributes declared in an instance are
    expected to be passed in 'args' to all construct methods, because
    those methods may inspect/handle/modify them before they are
    applied.  Ugly, fragile mechanism, but we must preserve it for
    back-compatibility for the time being.  Also revert the change in
    placement computation to look for `ignoreplacement` in attrs once
    again.  Fix up toString and _dbg_name to work without needing
    access to .prototype (and to print the `tagname`, not the
    `classname`, since the user will be more familiar with the
    tagname.

    runlzunit: Run the browser in the background on OS X, so I can do
    other work while I test.

    lztestmanager: Only turn of logging for swf9, otherwise `ant
    runlzunit` will always fail!

    build.xml: Default swf tests to swf8.

Tests:
    ant lztest, and runlzunit, amazon, test case from LPP-5762

Files:
M      WEB-INF/lps/lfc/core/LzNode.lzs
M      build-tools/runlzunit.sh
M      lps/components/lztest/lztestmanager.lzx
M      lps/components/base/basetree.lzx
M      build.xml

Changeset: <http://svn.openlaszlo.org/openlaszlo/patches/20080411-ptw-r.tar>http://svn.openlaszlo.org/openlaszlo/patches/20080411-ptw-r.tar



Reply via email to