[Laszlo-checkins] r12788 - in openlaszlo/branches/4.2: . WEB-INF/lps/server/src/org/openlaszlo/sc lps/components/rpc

ptw@openlaszlo.org ptw at openlaszlo.org
Sat Feb 7 12:17:50 PST 2009


Author: ptw
Date: 2009-02-07 12:17:46 -0800 (Sat, 07 Feb 2009)
New Revision: 12788

Modified:
   openlaszlo/branches/4.2/
   openlaszlo/branches/4.2/WEB-INF/lps/server/src/org/openlaszlo/sc/JavascriptGenerator.java
   openlaszlo/branches/4.2/lps/components/rpc/javarpc.lzx
   openlaszlo/branches/4.2/lps/components/rpc/soap.lzx
   openlaszlo/branches/4.2/lps/components/rpc/xmlrpc.lzx
Log:
Merged revisions 12787 via svnmerge from 
http://svn.openlaszlo.org/openlaszlo/trunk

.......
  r12787 | dda | 2009-02-07 14:44:33 -0500 (Sat, 07 Feb 2009) | 45 lines
  
  Change 20090206-dda-z by dda at lester-2.local on 2009-02-06 22:16:07 EST
      in /Users/dda/laszlo/src/svn/openlaszlo/trunk-g/test
      for http://svn.openlaszlo.org/openlaszlo/trunk/test
  
  Summary: With catcherrors=true, disable try/catch/closure when 'arguments' is used.
  
  New Features:
  
  Bugs Fixed: LPP-7721 [xml-rpc is not working when "compiler.swf9.catcherrors=true"]
  
  Technical Reviewer: ptw (pending)
  QA Reviewer: (pending)
  Doc Reviewer: (pending)
  
  Documentation:
  
  Release Notes:
  
  Details:
      ** for consideration in 4.2.0.1
  
      'arguments' refers to the arguments passed to the enclosing function, and allows some
      clever examination of arguments dynamically.  With catcherrors=true, an additional
      function closure is wrapped around each function within a try/catch, and the extra
      function thwarts the use of 'arguments' within the body of the original function.
      To avoid such problems, we disable catcherrors for any functions that refer to
      the magic 'arguments'.  This allows us to remove the workaround pragmas added
      to lps/components (which also disabled catcherrors, but for specific functions)
      As a bonus, smokecheck now passes with catcherrors enabled.
  
      It's true that now a small percentage of functions will not have the try/catch wrapping
      that used to have it.  However, such functions should be relative rare, will probably
      be in component code rather than user code, and if in user code, would probably not
      be a top level function.  Any such functions that are not top level functions would
      will be under the control of a higher level try/catch block.  Finally, any such functions
      that we now don't wrap may well have been broken under the previous implementation.
  
  Tests:
    With catcherrors=true: 
        {smokecheck,lzpix,weather} x {swf8,swf9,dhtml} 
    Verified that testcase submitted with LPP-7721 works.
    Verified that Tucker's test case from LPP-7514 works. (illustrating that an error in a function
      is ignored, allowing the function to return 'normally' and execution to continue).
.......



Property changes on: openlaszlo/branches/4.2
___________________________________________________________________
Name: svnmerge-integrated
   - /openlaszlo/branches/4.1:1-10153 /openlaszlo/branches/devildog:1-8432 /openlaszlo/branches/pagan-deities:1-7955,8825,10756-10920,10922-10928,10930-10935,11151,11207,11554 /openlaszlo/branches/paperpie:1-6504,6506-6574,6576-7135,7137-7235 /openlaszlo/branches/wafflecone:1-5746,5818-6068,6070-6205,6207-6213,6216-6265,6267-6368,6370-6431,6433-6450,6497,6509,6661,7097,7872 /openlaszlo/trunk:1-12154,12172-12175,12177-12185,12187-12194,12196,12201,12208,12229,12251-12252,12254-12255,12257-12258,12260,12262-12266,12268-12269,12271-12275,12278-12285,12303,12318-12323,12345,12360,12403,12420,12424,12429,12457,12473,12477,12508,12594,12596,12603,12664,12669,12675,12677,12719,12737,12752,12757,12771,12781
   + /openlaszlo/branches/4.1:1-10153 /openlaszlo/branches/devildog:1-8432 /openlaszlo/branches/pagan-deities:1-7955,8825,10756-10920,10922-10928,10930-10935,11151,11207,11554 /openlaszlo/branches/paperpie:1-6504,6506-6574,6576-7135,7137-7235 /openlaszlo/branches/wafflecone:1-5746,5818-6068,6070-6205,6207-6213,6216-6265,6267-6368,6370-6431,6433-6450,6497,6509,6661,7097,7872 /openlaszlo/trunk:1-12154,12172-12175,12177-12185,12187-12194,12196,12201,12208,12229,12251-12252,12254-12255,12257-12258,12260,12262-12266,12268-12269,12271-12275,12278-12285,12303,12318-12323,12345,12360,12403,12420,12424,12429,12457,12473,12477,12508,12594,12596,12603,12664,12669,12675,12677,12719,12737,12752,12757,12771,12781,12787

Modified: openlaszlo/branches/4.2/WEB-INF/lps/server/src/org/openlaszlo/sc/JavascriptGenerator.java
===================================================================
--- openlaszlo/branches/4.2/WEB-INF/lps/server/src/org/openlaszlo/sc/JavascriptGenerator.java	2009-02-07 19:44:33 UTC (rev 12787)
+++ openlaszlo/branches/4.2/WEB-INF/lps/server/src/org/openlaszlo/sc/JavascriptGenerator.java	2009-02-07 20:17:46 UTC (rev 12788)
@@ -1246,13 +1246,15 @@
     // not propogated to our caller.
     // To preserve return types, we implement this with a closure,
     // but that introduces restrictions:
-    // We cannot put a super call in a closure.
-    // Having another function closure within a closure apparently
-    // causes problems accessing certain variables for the flex compiler.
+    // - We cannot put a super call in a closure.
+    // - Having another function closure within a closure apparently
+    //   causes problems accessing certain variables for the flex compiler.
+    // - We cannot put code that references 'arguments' into a closure.
     boolean tryAll = options.getBoolean(Compiler.CATCH_FUNCTION_EXCEPTIONS)
       && matchingAncestor(node, ASTFunctionExpression.class, false) == null
       && matchingDescendant(node, ASTSuperCallExpression.class, false) == null
       && matchingDescendant(node, ASTFunctionExpression.class, false) == null
+      && matchingIdentifier(node, "arguments") == null
       && functionName != null;
       
     String tryType = "";
@@ -1596,6 +1598,26 @@
     return null;
   }
 
+  // walk down the AST and find a match of an identifier with a name
+  SimpleNode matchingIdentifier(SimpleNode node, String identName) {
+    if (node == null) {
+      return null;
+    }
+    else if (node instanceof ASTIdentifier && ((ASTIdentifier)node).getName().equals(identName)) {
+      return node;
+    }
+    else {
+      SimpleNode[] children = node.getChildren();
+      for (int i=0; i<children.length; i++) {
+        SimpleNode result = matchingIdentifier(children[i], identName);
+        if (result != null) {
+          return result;
+        }
+      }
+    }
+    return null;
+  }
+
   SimpleNode translateLiteralNode(SimpleNode node) {
     return node;
   }

Modified: openlaszlo/branches/4.2/lps/components/rpc/javarpc.lzx
===================================================================
--- openlaszlo/branches/4.2/lps/components/rpc/javarpc.lzx	2009-02-07 19:44:33 UTC (rev 12787)
+++ openlaszlo/branches/4.2/lps/components/rpc/javarpc.lzx	2009-02-07 20:17:46 UTC (rev 12788)
@@ -161,7 +161,6 @@
 
                 var DOREQ = stubinfo['doreq'] ? stubinfo['doreq'] : false;
                 var DORES = stubinfo['dores'] ? stubinfo['dores'] : false;
-#pragma "catchFunctionExceptions=false"
                 var stubfunc = function (){
                    var args = arguments.callee.args;
                    return LzJavaRPCService.invoke(

Modified: openlaszlo/branches/4.2/lps/components/rpc/soap.lzx
===================================================================
--- openlaszlo/branches/4.2/lps/components/rpc/soap.lzx	2009-02-07 19:44:33 UTC (rev 12787)
+++ openlaszlo/branches/4.2/lps/components/rpc/soap.lzx	2009-02-07 20:17:46 UTC (rev 12788)
@@ -99,7 +99,6 @@
            // "service": "MathService",
            // "wsdl": "http://www.dotnetjunkies.com/quickstart/aspplus......./mathservice.asmx?WSDL"},
            //                                            args.superclass.secure,
-#pragma "catchFunctionExceptions=false"
            var stubfunc = function (){
                var args = arguments.callee.args;
                return LzSOAPService.invoke(

Modified: openlaszlo/branches/4.2/lps/components/rpc/xmlrpc.lzx
===================================================================
--- openlaszlo/branches/4.2/lps/components/rpc/xmlrpc.lzx	2009-02-07 19:44:33 UTC (rev 12787)
+++ openlaszlo/branches/4.2/lps/components/rpc/xmlrpc.lzx	2009-02-07 20:17:46 UTC (rev 12788)
@@ -31,7 +31,6 @@
 
                 // create proxy for a particular funcname only once.
                 if ( this.proxy[method] == null ) {
-#pragma "catchFunctionExceptions=false"
                     this.proxy[method] = function (paramArr, delegate) {
                         var args = arguments.callee.args;
                         LzXMLRPCService.invoke(delegate, paramArr, 



More information about the Laszlo-checkins mailing list