Author: pbr
Date: 2007-08-02 11:28:54 -0700 (Thu, 02 Aug 2007)
New Revision: 5912

Modified:
   openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/data/LzDataElement.lzs
Log:
Change 20070802-Philip-6 by [EMAIL PROTECTED] on 2007-08-02 10:58:11 EST
   in /cygdrive/f/laszlo/svn/src/svn/openlaszlo/branches/wafflecone
   for http://svn.openlaszlo.org/openlaszlo/branches/wafflecone

Summary: Fix LzDataElement.makeNodeList()

New Features:

Bugs Fixed: LPP-4418

Technical Reviewer: ptw
QA Reviewer: (pending)
Doc Reviewer: (pending)

Documentation:

Release Notes:

Details:
In 3.4 you can call the static method LzDataElement.makeNodeList() to create an
array of LzDataElement objects. This is broken in Wafflecone (and Legals). In Wa
fflecone, the method isn't defined as static and it exists in LzDataElementTrait
. I fixed the static in the trait and created a static in LzDataElement. The def
inition of makeNodeList() also broke (it produced at most 1 object) when the fil
e was updated to the new class system.

Tests:

This app now runs in wafflecone and produces the same results as 3.4:

<canvas debug="true">
 <method event="oninit"><![CDATA[
   var nodes = LzDataElement.makeNodeList(5, 'mynode');
   for (var i=0; i<nodes.length; i++) {
     Debug.write(i, nodes[i]);
   }
   ]]>
 </method>
</canvas>

If you run this on an unpatched version of wafflecone:

 ERROR: makeNodeList.lzx:3: call to undefined method 'makeNodeList'
 ERROR: makeNodeList.lzx:4: undefined object does not have a property 'length'

 WARNING: makeNodeList.lzx:4: reference to undefined property 'length'

If you run this on a patched version of wafflecone (or 3.4):

 0 ?\194?\171LzDataElement#0| <mynode/>?\194?\187
 1 ?\194?\171LzDataElement#1| <mynode/>?\194?\187
 2 ?\194?\171LzDataElement#2| <mynode/>?\194?\187
 3 ?\194?\171LzDataElement#3| <mynode/>?\194?\187
 4 ?\194?\171LzDataElement#4| <mynode/>?\194?\187


Files:
M      WEB-INF/lps/lfc/data/LzDataElement.lzs

Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20070802-Philip-6.tar


Modified: openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/data/LzDataElement.lzs
===================================================================
--- openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/data/LzDataElement.lzs       
2007-08-02 17:42:58 UTC (rev 5911)
+++ openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/data/LzDataElement.lzs       
2007-08-02 18:28:54 UTC (rev 5912)
@@ -614,20 +614,6 @@
     return c;
 }
 
-/**
-  * Returns a list of empty nodes, each named 'name'.
-  * @param Number count: how many nodes to create.
-  * @param String name: the name for each node
-  * @return Array: list of new nodes.
-  */
-function makeNodeList(count, name) {
-    var a = [];
-    for (var i=0; i < count; i++) {
-        a[i] = new LzDataElement(name, {}, null);
-        return a;
-    }
-}
-
 } // End LzDataElementTrait
 
 /**
@@ -690,5 +676,19 @@
   */
 var attributes      = null;
 
+/**
+  * Returns a list of empty nodes, each named 'name'.
+  * @param Number count: how many nodes to create.
+  * @param String name: the name for each node
+  * @return Array: list of new nodes.
+  */
+static function makeNodeList(count, name) {
+    var a = [];
+    for (var i=0; i < count; i++) {
+        a[i] = new LzDataElement(name, {}, null);
+    }
+    return a;
+}
+
 static var valueToElement = LzDataElementTrait.valueToElement;
 }


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

Reply via email to