[Laszlo-dev] Is this compiled code for a method, in debug mode, correct?

Henry Minsky hminsky at laszlosystems.com
Mon Sep 21 11:54:25 PDT 2009


I was looking at the as3 generated code for an onclick handler which came
from this source code

       <button onclick="canvas.test(1)">click me </button>

It looks like this, when compiled in debug mode

public function $lzc$handle_onclick$$args$2Elzx_11_41_$m492 ($lzc$ignore_$1)
{
    try {
        canvas.test(1);
    }
    catch ($lzsc$e) {
        if ($lzsc$e is Error) {
            if (lz["$lzsc$thrownError"] === $lzsc$e) {
                throw $lzsc$e;
            };
            $lzsc$runtime.reportException("args.lzx", 11, $lzsc$e);
        };
        throw $lzsc$e;
    }
}

If some error is thrown in the call to "test", this wrapper looks like it
will always catch and then
 rethrow it. Is this the expected behavior? I sort of thought we were going
to catch and report the error
to our debugger, and then discard it rather than rethrowing it, in this case
(debugger on)?

-- 
Henry Minsky
Software Architect
hminsky at laszlosystems.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.openlaszlo.org/pipermail/laszlo-dev/attachments/20090921/03116e41/attachment.html


More information about the Laszlo-dev mailing list