<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">Tucker, let me know if you cannot review. &nbsp;This changeset is against trunk, but it's destined for 4.2.0.x.</p><p style="margin: 0.0px 0.0px 0.0px 0.0px"><br></p><p style="margin: 0.0px 0.0px 0.0px 0.0px">Change 20090311-dda-g by <a href="mailto:dda@lester-2.local">dda@lester-2.local</a> on 2009-03-11 14:44:05 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-h</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: Fix catcherrors problems, including getting file/line numbers when errors are thrown</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-7900 SWF9 catcherrors=true exposes problem in return types</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span>LPP-7895 Make try/catch error messages give accurate line numbers</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; 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>JavascriptGenerator.java:</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; &nbsp; &nbsp; </span>As a result of the fix for LPP-7789, 'void' is set as a return type, but when that happens,</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; &nbsp; &nbsp; </span>catcherrors cannot emit a 'return' instruction.<span class="Apple-converted-space">&nbsp; </span>This fixes LPP-7900.</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>Function.java:</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; &nbsp; &nbsp; </span>The tag compiler was creating code like this:</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; &nbsp; &nbsp; </span>function x(</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp;&nbsp; &nbsp; </span>#file x.lzx</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp;&nbsp; &nbsp; </span>#line 3</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp;&nbsp; &nbsp; &nbsp; </span>} {</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp;&nbsp; &nbsp; </span>#file x.lzx</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp;&nbsp; &nbsp; </span>#line 3</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span>stuff();</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; &nbsp; &nbsp; </span>#file</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; &nbsp; &nbsp; </span>}</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><span class="Apple-converted-space">&nbsp;&nbsp; &nbsp; &nbsp;</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; &nbsp; &nbsp; </span>function y(<span class="Apple-converted-space">&nbsp; &nbsp; &nbsp; &nbsp; </span>// &lt;--- This node has no file/line</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp;&nbsp; &nbsp; </span>#file x.lzx</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp;&nbsp; &nbsp; </span>#line 3</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp;&nbsp; &nbsp; &nbsp; </span>etc.</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; &nbsp; </span>It's careful to set the the #file to nothing for its boilerplate code, but that means that the</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; &nbsp; &nbsp; </span>function node may not have any file/line information.<span class="Apple-converted-space">&nbsp; </span>The function node is used to derive</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; &nbsp; &nbsp; </span>file/line for the catcherrors error call, so it must be set.</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; &nbsp; </span>At the risk of being a little wasteful, this inserts another #file/#line pair just in front of</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; &nbsp; &nbsp; </span>each function declaration.</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; &nbsp; </span>At the risk of being a little wasteful, this inserts another #file/#line pair just in front of</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; &nbsp; &nbsp; </span>each function declaration.</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; &nbsp; </span>The usual smoke/weather/lzpix tests on swf8/swf9/dhmtl</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>Running test case to illustrate the originals problems:</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"><span class="Apple-converted-space">&nbsp; &nbsp; </span>&lt;class name="mywindow" width="300"></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; &nbsp; &nbsp; &nbsp; </span>&lt;button onclick="this.parent.parent.canvas_f()" >BaseClass mywindow&lt;/button></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; &nbsp; </span>&lt;/class></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>Debug.info("1 zebra");</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp;&nbsp; </span>Debug.info("2");</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>Debug.info("3...?");</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>Debug.info("4!!");</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>// divide by zero doesn't give an exception, but</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 will.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; </span>//return w[x]/x;</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"><span class="Apple-converted-space">&nbsp; </span>&lt;mywindow bgcolor="#cc8c8c"/><span class="Apple-converted-space">&nbsp;</span></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"><span class="Apple-converted-space">&nbsp; &nbsp; </span>Now compiles, and when it hits the exception, we now get a proper file/line:</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; &nbsp; &nbsp; </span>ERROR @LPP-7270f.lzx#19: TypeError: Error #1009<span class="Apple-converted-space">&nbsp;</span></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/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/Function.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/20090311-dda-g.tar">http://svn.openlaszlo.org/openlaszlo/patches/20090311-dda-g.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>