[Laszlo-dev] For Review: Change 20090204-dda-1 Summary: Local fix to xml-rpc to work with catcherrors=true

Donald Anderson dda at ddanderson.com
Wed Feb 4 13:26:52 PST 2009


Change 20090204-dda-1 by dda at lester-2.local on 2009-02-04 15:52:38 EST
     in /Users/dda/laszlo/src/svn/openlaszlo/trunk-g
     for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: Local fix to xml-rpc to work with catcherrors=true

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:
   ** change set made to trunk, for consideration for 4.2.0.1  
(probably just xmlrpc.lzx)

    lps/components/rpc/xmlrpc.lzx
        Installed a workaround for the problem:
        A closure written in xmlrpc.lzx uses arguments.callee.args,  
but when it is processed with the try/catch block
        (with its own closure inserted) the meaning of  
arguments.callee.args changes.
        This 'tryall' processing was only intended for top level  
functions, but we needed to allow it to be
        installed for function expressions as well to allow for state  
methods (which appear to us as closures within an
        initialization list).  The workaround is simply to turn off  
catchFunctionExceptions via a pragma to
        address this narrow case.

        As this technique may be used elsewhere, we might consider a  
more holistic solution.  Such as one of:
           A) have the tag compiler mark 'top level' closure that it  
generates so we can turn off 'tryall'
              for other function closures.
           B) detect the use of 'arguments' (would there be anything  
else to look for?) and cause the original
              arguments to be saved and used as appropriate.  Perhaps  
an initial 'save' of arguments.callee.xxxx
              if pushed out of the try block.
           C) have a runtime check to only call use the 'tryall' try  
block only if a tryall hasn't been established
              yet.  Then we'd really only do this on a top level  
function.  But who says top level functions can't
              access arguments.callee.xxxx (also a problem with  
solution A)?  Also, this is pretty ugly.

    WEB-INF/lps/config/lps.properties
        Changed the default for lps.properties to set catcherrors to  
false.
        This was apparently mistakenly enabled recently.  We don't  
have it on as
        the default since it is still undocumented/experimental, and  
smokecheck
        does not pass with it on.

Tests:
     With catcherrors=true:
       Test case from LPP-7721
       Tucker's test case in LPP-7514 to verify that state methods work
     With catcherrors=false:
       {smokecheck,lzpix} x {swf8,swf9,dhtml}

Files:
M      WEB-INF/lps/config/lps.properties
M      lps/components/rpc/xmlrpc.lzx

Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20090204-dda-1.tar



--

Don Anderson
Java/C/C++, Berkeley DB, systems consultant

voice: 617-306-2057
email: dda at ddanderson.com
www: http://www.ddanderson.com





-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.openlaszlo.org/pipermail/laszlo-dev/attachments/20090204/b373c833/attachment-0001.html


More information about the Laszlo-dev mailing list