[Laszlo-checkins] r10555 - in openlaszlo/trunk: WEB-INF/lps/lfc/compiler WEB-INF/lps/lfc/kernel/swf lps/components/rpc lps/components/rpc/library

hqm@openlaszlo.org hqm at openlaszlo.org
Fri Aug 1 06:26:25 PDT 2008


Author: hqm
Date: 2008-08-01 06:26:20 -0700 (Fri, 01 Aug 2008)
New Revision: 10555

Modified:
   openlaszlo/trunk/WEB-INF/lps/lfc/compiler/LzFormatter.lzs
   openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzLoadQueue.as
   openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzLoader.lzs
   openlaszlo/trunk/lps/components/rpc/library/xmlrpcmessage.js
   openlaszlo/trunk/lps/components/rpc/rpc.lzx
Log:
Change 20080731-hqm-j by hqm at badtzmaru-4.local on 2008-07-31 23:44:48 EDT
    in /Users/hqm/openlaszlo/trunk4
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: fix more bugs in javarpc, and in swf8 loader

New Features:

Bugs Fixed:

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

Documentation:

Release Notes:

Details:
    
+ fix problem with null values in params when calling javarpc 

+ fix problem with swf8 LzLoadQueue, the connection was not getting
marked as closed after it loaded, so the LzLoadQueue.openConx would
max out after a few loads.

+ LzFormatter in swf9 got a runtime error when calling 'instanceof' on null, changed it to 'is' test

Tests:

test/lfc/data/alldata.lzx
test/rpc/javarpc/session.lzx
test/rpc/javarpc/simple.lzx
test/rpc/javarpc/session-counter.lzx



Modified: openlaszlo/trunk/WEB-INF/lps/lfc/compiler/LzFormatter.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/compiler/LzFormatter.lzs	2008-08-01 12:14:21 UTC (rev 10554)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/compiler/LzFormatter.lzs	2008-08-01 13:26:20 UTC (rev 10555)
@@ -164,7 +164,7 @@
     var al = args.length;
     // 'write compatibility mode': control is not a string or # of
     // arguments is incompatible with control directives.
-    if ((! (typeof control == 'string' || control instanceof String)) ||
+    if ((! (typeof control == 'string' || control is String)) ||
         ((al > 0) != (control.indexOf('%') >= 0))) {
       // Process each value to individually so they can be
       // 'presented' as objects if applicable

Modified: openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzLoadQueue.as
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzLoadQueue.as	2008-08-01 12:14:21 UTC (rev 10554)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzLoadQueue.as	2008-08-01 13:26:20 UTC (rev 10555)
@@ -111,6 +111,7 @@
         // LzDataNodes.
 
         this.onload(true);
+        LzLoadQueue.loadFinished( this );
         this.loader.gotRawData(src, this);
     }
 }

Modified: openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzLoader.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzLoader.lzs	2008-08-01 12:14:21 UTC (rev 10554)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzLoader.lzs	2008-08-01 13:26:20 UTC (rev 10555)
@@ -185,8 +185,6 @@
         return;
     }
 
-    LzLoadQueue.loadFinished( loadobj );
-
     this.lastloadtime = getTimer() - loadobj.loadtime;
 
     var err;

Modified: openlaszlo/trunk/lps/components/rpc/library/xmlrpcmessage.js
===================================================================
--- openlaszlo/trunk/lps/components/rpc/library/xmlrpcmessage.js	2008-08-01 12:14:21 UTC (rev 10554)
+++ openlaszlo/trunk/lps/components/rpc/library/xmlrpcmessage.js	2008-08-01 13:26:20 UTC (rev 10555)
@@ -64,7 +64,9 @@
 
             xml += "<param>\n";
 
-            xml += "<value>" + XMLRPCMessage.getParamXML(XMLRPCMessage.dataTypeOf(data),data) + "</value>\n";
+            var dtype = XMLRPCMessage.dataTypeOf(data);
+
+            xml += "<value>" + XMLRPCMessage.getParamXML(dtype,data) + "</value>\n";
     
             xml += "</param>\n";
         }
@@ -77,6 +79,9 @@
 
     static function dataTypeOf (o){
         // identifies the data type
+        if ( o == null) {
+            return "string";
+        }
         var type = typeof(o);
         type = type.toLowerCase();
         switch(type){
@@ -88,12 +93,12 @@
             // Number and Date have the same prototype
             if ( o is  LzRPCDoubleWrapper ) {
                 type = "doublewrapper";
-            } else if ( o instanceof Date && o.getMilliseconds != null ) {
+            } else if ( o is Date && o.getMilliseconds != null ) {
                 type = "date";
-            } else if ( o instanceof Number ) {
+            } else if ( o is Number ) {
                 if (Math.round(o) == o) type = "i4";
                 else type = "double";
-            } else if ( o instanceof Array ) {
+            } else if ( o is Array ) {
                 type = "array";
             } else {
                 type = "struct";

Modified: openlaszlo/trunk/lps/components/rpc/rpc.lzx
===================================================================
--- openlaszlo/trunk/lps/components/rpc/rpc.lzx	2008-08-01 12:14:21 UTC (rev 10554)
+++ openlaszlo/trunk/lps/components/rpc/rpc.lzx	2008-08-01 13:26:20 UTC (rev 10555)
@@ -408,11 +408,7 @@
                         // if getValue method is declared in param, call that
                         // instead to get value.
                         var tsi = this.subnodes[i];
-                        if (tsi['getValue'] != null && tsi.getValue['prototype'] != null) {
-                            params[i] = tsi.getValue();
-                        } else {
-                            params[i] = tsi.value;
-                        }
+                        params[i] = tsi.getValue();
                     }
                 }
             } else if (! (params instanceof Array)) {
@@ -739,13 +735,16 @@
     </class>
 
 
-    <!-- Element to use inside remotecall. -->
+    <!-- 'Element to use inside remotecall. -->
     <class name="param" extends="node">
         <!--- Value to use for paramter. A getValue() method can be declared
               inside param to use its return as the parameter value. If both
               value attribute and getValue method are declared, param will use
               getValue(). -->
         <attribute name="value" value="null" type="expression" />
+        <method name="getValue">
+          return this.value;
+        </method>
         <doc>
             <tag name="shortdesc"><text>param tag for remotecall</text></tag>
             <text>



More information about the Laszlo-checkins mailing list