<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, this has a flaw (as you'll see) but it does work, you might want to take it depending on</p><p style="margin: 0.0px 0.0px 0.0px 0.0px">how time critical it is. &nbsp;I can work on finding/fixing the flaw tomorrow too.</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">- Don</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 20090108-dda-O by <a href="mailto:dda@lester.local">dda@lester.local</a> on 2009-01-08 06:25:08 EST</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-c</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: Remove references to 'this' in static functions</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-7514 (Compilation error when setting compiler.swf9.catcherrors=true in lps.properties)</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>The implementation of catchFunctionExceptions (catcherrors) was blind to static functions,</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; &nbsp; </span>'this' cannot be used in static functions.</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>To tell that a function is static, this changeset peeks up the tree to the parent</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; &nbsp; </span>of the function node, which should be a ASTModifiedDefinition ('moddef'), and checks the static</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; &nbsp; </span>flag there.<span class="Apple-converted-space">&nbsp; </span>A shortcut in copying part of the tree without the moddef</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; &nbsp; </span>needed to be fixed, to do that, a 'shallow copy' function was added to the moddef class.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; &nbsp; </span>Though this change is required for the static detection to work in SWF9,</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; &nbsp; </span>it also causes problems for SWF8 compilation (**), so has</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; &nbsp; </span>been disabled for SWF8.<span class="Apple-converted-space">&nbsp; </span>A TODO has been left in the code.</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>An alternate way of detecting static-ness is to set a 'static' property in the options.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; &nbsp; </span>I had tried in addressing LPP-5813 (not yet completed), and had some trouble getting</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; &nbsp; </span>it to work.<span class="Apple-converted-space">&nbsp; </span>It's not clear which one is cleaner, but the one that works wins for me.</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>This fix is slightly more encompassing than it needs to be, it also disables any possibility</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; &nbsp; </span>of applying the WITH_THIS directive within a static function.<span class="Apple-converted-space">&nbsp; </span>This should always be</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; &nbsp; </span>correct.<span class="Apple-converted-space">&nbsp; </span>Changing that to be narrower did not affect the SWF8 problem.</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>(**) If the moddef copy is used with SWF8 applications, this apparently triggers an</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; &nbsp; </span>error in the code generator..<span class="Apple-converted-space">&nbsp; </span>A difference of disassembled swf files shows that the</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; &nbsp; </span>errant file is missing pop instructions at the end of functions, 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">***************</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px">*** 4109,4115 ****</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; &nbsp; &nbsp; &nbsp; </span>end // of function<span class="Apple-converted-space">&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;</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; &nbsp; &nbsp; </span>end</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px">- <span class="Apple-converted-space">&nbsp; &nbsp; </span>pop</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; &nbsp; &nbsp; </span>push 'toString', '_root'</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; &nbsp; &nbsp; </span>getVariable</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px"><span class="Apple-converted-space">&nbsp; &nbsp; &nbsp; </span>with</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px">--- 4089,4094 ----</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; 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>(dhtml,swf8,swf9) x (lzpix,weather,smokecheck,hello) x (enable catcherrors, disable catcherrors)</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/CommonGenerator.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/CodeGenerator.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/sc/src/org/openlaszlo/sc/parser/ASTModifiedDefinition.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/20090108-dda-O.tar">http://svn.openlaszlo.org/openlaszlo/patches/20090108-dda-O.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>