<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Oh, right, that would have been a lot easier.<div>I'll make a new changeset.</div><div><br><div><div>On Jan 9, 2009, at 11:02 AM, P T Withington wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Shouldn't it be sufficient to simply use the same flag you use to ignore the withThis pragma for js2 to conditionalize emitting the `with (this)` in your try closure? (I think you use the `remaplocals()` predicate, but maybe that should be renamed `isjs2()`?<br><br>On 2009-01-09, at 09:44EST, Donald Anderson wrote:<br><br><blockquote type="cite">Change 20090108-dda-O by <a href="mailto:dda@lester.local">dda@lester.local</a> on 2009-01-08 06:25:08 EST<br></blockquote><blockquote type="cite"> in /Users/dda/laszlo/src/svn/openlaszlo/trunk-c<br></blockquote><blockquote type="cite"> for <a href="http://svn.openlaszlo.org/openlaszlo/trunk">http://svn.openlaszlo.org/openlaszlo/trunk</a><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Summary: Remove references to 'this' in static functions (revised)<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">New Features:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Bugs Fixed: LPP-7514 (Compilation error when setting compiler.swf9.catcherrors=true in lps.properties)<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Technical Reviewer: ptw (pending)<br></blockquote><blockquote type="cite">QA Reviewer: (pending)<br></blockquote><blockquote type="cite">Doc Reviewer: (pending)<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Documentation:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Release Notes:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Details:<br></blockquote><blockquote type="cite"> [This changeset revises an earlier one sent to review, fixing an ugly workaround.<br></blockquote><blockquote type="cite"> Everything indicated under Tests has been retested with this revision.]<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"> The implementation of catchFunctionExceptions (catcherrors) was blind to static functions,<br></blockquote><blockquote type="cite"> 'this' cannot be used in static functions.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"> To tell that a function is static, this changeset peeks up the tree to the parent<br></blockquote><blockquote type="cite"> of the function node, which should be a ASTModifiedDefinition ('moddef'), and checks the static<br></blockquote><blockquote type="cite"> flag there. A shortcut in copying part of the tree without the moddef<br></blockquote><blockquote type="cite"> needed to be fixed, to do that, a 'shallow copy' function was added to the moddef class.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"> An alternate way of detecting static-ness is to set a 'static' property in the options.<br></blockquote><blockquote type="cite"> I had tried in addressing LPP-5813 (not yet completed), and had some trouble getting<br></blockquote><blockquote type="cite"> it to work. It's not clear which one is cleaner, but the one that works wins for me.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"> This fix is slightly more encompassing than it needs to be, it also disables any possibility<br></blockquote><blockquote type="cite"> of applying the WITH_THIS directive within a static function. This should always be<br></blockquote><blockquote type="cite"> correct. Changing that to be narrower did not affect the SWF8 problem.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Tests:<br></blockquote><blockquote type="cite"> (dhtml,swf8,swf9) x (lzpix,weather,smokecheck,hello) x (enable catcherrors, disable catcherrors)<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Files:<br></blockquote><blockquote type="cite">M WEB-INF/lps/server/src/org/openlaszlo/sc/JavascriptGenerator.java<br></blockquote><blockquote type="cite">M WEB-INF/lps/server/src/org/openlaszlo/sc/CommonGenerator.java<br></blockquote><blockquote type="cite">M WEB-INF/lps/server/src/org/openlaszlo/sc/CodeGenerator.java<br></blockquote><blockquote type="cite">M WEB-INF/lps/server/sc/src/org/openlaszlo/sc/parser/ASTModifiedDefinition.java<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Changeset: <a href="http://svn.openlaszlo.org/openlaszlo/patches/20090108-dda-O.tar">http://svn.openlaszlo.org/openlaszlo/patches/20090108-dda-O.tar</a><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">--<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Don Anderson<br></blockquote><blockquote type="cite">Java/C/C++, Berkeley DB, systems consultant<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">voice: 617-306-2057<br></blockquote><blockquote type="cite">email: <a href="mailto:dda@ddanderson.com">dda@ddanderson.com</a><br></blockquote><blockquote type="cite">www: <a href="http://www.ddanderson.com">http://www.ddanderson.com</a><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><br></div></blockquote></div><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: <a href="mailto:dda@ddanderson.com">dda@ddanderson.com</a><br>www: <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></div></body></html>