Yeah this has always been a not-officially supported but useful feature, that you could say "foo = something" and create a global, or at least something that acts like a global in the expressions you write in the debugger.
It would be great if we could figure out a way to make this work in swf10. I wonder if we could go so far as to try to recognize statements of the form "somevar = someexpression" and put code that wraps around to check if "somevar" is not yet defined, and if so, to define it in the Debug.environment. On Mon, Sep 28, 2009 at 9:54 AM, André Bargull <[email protected]>wrote: > Forget to mention: > There is now a funny effect in swf9/swf10 because of the with-block. You > can evaluate the expression 'lzx> foo = 42' even if 'foo' is not a defined > variable, but if you later want to retrieve the value of 'foo' by evaluating > 'lzx> foo', the runtime reports a ReferenceError. Without the with-block, > you'd get a static compiler error because 'foo' is not defined. But as the > with-block forces dynamic look-up, the runtime needs perform this check, but > apparently fails for assignment expressions, only dereferencing gives the > ReferenceError. I'd consider this as a bug... > > > > On 9/28/2009 3:28 PM, André Bargull wrote: > >> Change 20090928-bargull-YnE by barg...@dell--p4--2-53 on 2009-09-28 >> 12:39:38 >> in /home/Admin/src/svn/openlaszlo/trunk >> for http://svn.openlaszlo.org/openlaszlo/trunk >> >> Summary: update eval-script compiler to use Debug.environment >> >> New Features: LPP-8519 (wrap evalscript in "with(Debug.environment){...}") >> >> Bugs Fixed: >> >> Technical Reviewer: ptw >> QA Reviewer: hqm >> Doc Reviewer: (pending) >> >> Documentation: >> >> Release Notes: >> >> Details: >> Compiler.java: >> Added "compileEvalScript()" to avoid duplicate code for swf8 and AS3 >> runtimes. Every eval-script is now surrounded with "with(Debug.environment) >> {...}" in order to allow eval-expressions to access properties from the >> Debugger environment. >> For swf8 compilation, the catch block only caught >> "sc.parser.ParseException", this is now just "Exception" (it was already >> just "Exception" for swf9), so every possible exception is caught (e.g. >> otherwise an unterminated multi-line comment throws the compiler out of >> whack). >> Apparently it's no longer necessary to prepend "_level0" before references >> to "Debug" in swf8, so I removed it. I've also added try-catch for swf8 like >> it's already done in swf9, because otherwise throwing an Error leads a >> timeout of the eval-request (see 1st comment on LPP-8519). And I wonder how >> remote debug requests did work in the past, because there was a stray >> semicolon in the code (l.493). And made sure that Debug.sockWriteAsXML() is >> always called for remote debug request, so the Debug.inEvalRequest flag gets >> updated. >> Also removed the excessive import list for swf9, because it has no use >> since the script isn't executed in "DebugExec" but in "DebugEvaluate". >> LzDebug.as (swf8): >> - removed override of "displayResult()", no longer necessary >> LzDebug.as (swf9): >> - removed override of "displayResult()", no longer necessary >> - cleaned up imports >> - removed '_', '__' and '___', no longer global >> - removed "TODO" from comment in "IDForObject()" >> LzMemory.lzs: >> - updated to use "Debug.environment" instead of "global" for '_', '__' and >> '___' >> LzCanvas.lzs: >> - added "swf10" to the supported runtimes comment >> >> >> >> Tests: >> try eval'ing expression, statements and erroneous inputs in swf8, swf9, >> swf10 >> >> Files: >> M WEB-INF/lps/lfc/debugger/platform/swf/LzDebug.as >> M WEB-INF/lps/lfc/debugger/platform/swf9/LzDebug.as >> M WEB-INF/lps/lfc/debugger/LzMemory.lzs >> M WEB-INF/lps/lfc/views/LaszloCanvas.lzs >> M WEB-INF/lps/server/src/org/openlaszlo/compiler/Compiler.java >> >> Changeset: >> http://svn.openlaszlo.org/openlaszlo/patches/20090928-bargull-YnE.tar >> >> >> -- Henry Minsky Software Architect [email protected]
_______________________________________________ Laszlo-reviews mailing list [email protected] http://www.openlaszlo.org/mailman/listinfo/laszlo-reviews
