[Laszlo-dev] For Review: Change 20090206-dda-z Summary: With catcherrors=true, disable try/catch/closure when 'arguments' is used.

P T Withington ptw at laszlosystems.com
Sat Feb 7 11:33:09 PST 2009


I'm approving this because it appears safe and we would like it in  
4.2.0.1.

I think we should file an improvement to re-address this in 4.2.1,  
using something more like the Debug.evalCarefully technology, which is  
used in DHTML.  The evalCarefully approach would be to wrap the  
potentially erring function at the call site, where the analysis of  
free references will be much simpler, hence the creation of a closure  
that does not perturb those references will be simpler too.

We can analyze whether putting the try/catch inline at call sites  
rather than in function  bodies causes too much code bloat and measure  
that against the speed penalty of using an evalCarefully subroutine  
instead.

Please check in this fix and create a new bug with the above  
suggestions.

On 2009-02-06, at 22:48EST, Donald Anderson wrote:

> 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).
>
> Files:
> M      WEB-INF/lps/server/src/org/openlaszlo/sc/ 
> JavascriptGenerator.java
> M      lps/components/rpc/xmlrpc.lzx
> M      lps/components/rpc/javarpc.lzx
> M      lps/components/rpc/soap.lzx
>
> Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20090206-dda-z.tar
>
>
>
> --
>
> Don Anderson
> Java/C/C++, Berkeley DB, systems consultant
>
> voice: 617-306-2057
> email: dda at ddanderson.com
> www: http://www.ddanderson.com
>
>
>
>
>



More information about the Laszlo-dev mailing list