<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><p style="margin: 0.0px 0.0px 0.0px 0.0px">Change 20090320-dda-M by <a href="mailto:dda@lester-2.local">dda@lester-2.local</a> on 2009-03-20 16:17:11 EDT</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; &nbsp; </span>in /Users/dda/laszlo/src/svn/openlaszlo/trunk-b</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; &nbsp; </span>for <a href="http://svn.openlaszlo.org/openlaszlo/trunk">http://svn.openlaszlo.org/openlaszlo/trunk</a></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px">Summary: Initial implementation of catcherrors for DHTML</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px">New Features:</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px">Bugs Fixed: LPP-7824: Add compiler option to turn on catch-errors (currently swf9) in DHTML</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px">Technical Reviewer: ptw (pending)</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px">QA Reviewer: (pending)</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px">Doc Reviewer: (pending)</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px">Documentation:</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px">Release Notes:</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; &nbsp; </span>The property name for catcherrors has changed.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; &nbsp; </span>Now, if you set compiler.catcherrors=true in your lps.properties file,</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; &nbsp; </span>you will enable catcherrors behavior.<span class="Apple-converted-space">&nbsp; </span>This works for SWF9 and DHTML runtimes.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; &nbsp; </span>The property used to be called compiler.swf9.catcherrors; that property is now ignored.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px">Details:</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; &nbsp; </span>This changeset enables the catcherrors code for DHTML.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; &nbsp; </span>- The property name to drive the feature has changed (see Release Notes above)</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; &nbsp; </span>- Fixed a mistake in matchingAncestor() so that it now works as advertised.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; &nbsp; </span>- For DHTML, I attempted to use the $lzsc$runtime class (currently only enabled for SWF9),</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; &nbsp; &nbsp; </span>but that class was not able to successfully call reportSourceWarning in DHTML.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; &nbsp; &nbsp; </span>For the time being, I'm calling $reportSourceWarning directly in DHTML.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; &nbsp; &nbsp; </span>A TODO has been left in, we should either find a way to resolve this or call</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; &nbsp; &nbsp; </span>reportSourceWarning directly for all runtimes.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; &nbsp; </span>- The implementation continues to use Compiler.PassThroughNodes for the fragments that implement</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; &nbsp; &nbsp; </span>the variable declaration and try/catch block.<span class="Apple-converted-space">&nbsp; </span>Without this, I've encountered problems probably</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; &nbsp; &nbsp; </span>related to an ordering problem - the references to the rewritten variable names are changed before</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; &nbsp; &nbsp; </span>the variable in the try block is created.<span class="Apple-converted-space">&nbsp; </span>(not sure about this).<span class="Apple-converted-space">&nbsp; </span>At any rate, DHTML continues</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; &nbsp; &nbsp; </span>to use PassThroughNodes.<span class="Apple-converted-space">&nbsp; </span>One consequence is that a 'warnUndefinedReferences' pragma is inserted</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; &nbsp; &nbsp; </span>into the parsedFragment and is not removed.<span class="Apple-converted-space">&nbsp; </span>So this change moves a change in SWF9ParseTreePrinter</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; &nbsp; &nbsp; </span>into ParseTreePrinter - pragmas are shown as commented (also fixed a newline error when moving that!)</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; &nbsp; &nbsp; </span>This allows the pragma to appear in the final AST.<span class="Apple-converted-space">&nbsp; </span>Better long term solutions are to remove the pragmas or</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; &nbsp; &nbsp; </span>better, solve the underlying problem that requires PassThroughNodes.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px">Tests:</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; </span>1. For regression, the usual {smokecheck,weather,lzpix} x {swf9,swf8,dhtml} -- with catcherrors enabled.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; </span>Note that I did not build the LFC with catcherrors enabled, we'll save that for another day.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; </span>2. For functionality, here is the minimal test case I use:</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px">&lt;canvas debug="true"></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; </span>&lt;simplelayout spacing="10" axis="y" /></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; </span>&lt;method name="canvas_f"></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp;&nbsp; </span>t1.setText("Before exception");</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp;&nbsp; </span>throwexcept(7,0);</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp;&nbsp; </span>t2.setText("After exception");</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; </span>&lt;/method></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; </span>&lt;method name="returnnull"></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp;&nbsp; </span>return null;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; </span>&lt;/method></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; </span>&lt;method name="throwexcept" args="w, x"></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; </span>// an array reference of a non array gives an exception</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; </span>return w + x + returnnull().foo;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp;</span>&lt;/method></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; </span>&lt;button name="b1" onclick="this.parent.canvas_f()" width="100" height="30" y="10">Press me&lt;/button></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; </span>&lt;text name="t1" bgcolor="#ccffcc" width="100" height="30" y="50"/></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; </span>&lt;text name="t2" bgcolor="#ccffcc" width="100" height="30" y="100"/></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px">&lt;script></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px">&lt;/script></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px">&lt;/canvas></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px">In SWF8, this gives:</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px">WARNING @LPP-7270g.lzx#14: reference to undefined property 'foo'<span class="Apple-converted-space">&nbsp;</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px">In SWF9, this gives:</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px">ERROR @LPP-7270g.lzx#12: TypeError: Error #1009<span class="Apple-converted-space">&nbsp;</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px">In DHTML, this now gives:</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px">ERROR @LPP-7270g.lzx#12: TypeError: Null value</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px">For SWF9/DHTML, the line number refers to the top of the function, as the try/catch</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px">block applies to the entire function.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px">Files:</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px">M<span class="Apple-converted-space">&nbsp; &nbsp; &nbsp; </span>WEB-INF/lps/config/lps.properties</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px">M<span class="Apple-converted-space">&nbsp; &nbsp; &nbsp; </span>WEB-INF/lps/server/src/org/openlaszlo/sc/JavascriptGenerator.java</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px">M<span class="Apple-converted-space">&nbsp; &nbsp; &nbsp; </span>WEB-INF/lps/server/src/org/openlaszlo/sc/SWF9ParseTreePrinter.java</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px">M<span class="Apple-converted-space">&nbsp; &nbsp; &nbsp; </span>WEB-INF/lps/server/src/org/openlaszlo/sc/Compiler.java</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px">M<span class="Apple-converted-space">&nbsp; &nbsp; &nbsp; </span>WEB-INF/lps/server/src/org/openlaszlo/sc/ParseTreePrinter.java</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px">Changeset: <a href="http://svn.openlaszlo.org/openlaszlo/patches/20090320-dda-M.tar">http://svn.openlaszlo.org/openlaszlo/patches/20090320-dda-M.tar</a></p>
<br><br><div> <span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br class="Apple-interchange-newline">--</div><div><br>Don Anderson<br>Java/C/C++, Berkeley DB, systems consultant<br><br>voice: 617-306-2057<br>email:&nbsp;<a href="mailto:dda@ddanderson.com">dda@ddanderson.com</a><br>www:&nbsp;<a href="http://www.ddanderson.com/">http://www.ddanderson.com</a><br></div></div></span></span><br class="Apple-interchange-newline"></div></span></div></span><br class="Apple-interchange-newline"></div></span><br class="Apple-interchange-newline"></div></span><br class="Apple-interchange-newline"> </div><br></body></html>