<html><body bgcolor="#FFFFFF"><div>Swf8 is a js1<br><br>On Oct 6, 2008, at 9:18 AM, Donald Anderson <<a href="mailto:dda@ddanderson.com">dda@ddanderson.com</a>> wrote:<br><br></div><div></div><blockquote type="cite"><div>Okay it's <div> <a href="http://www.openlaszlo.org/jira/browse/LPP-7127"><a href="http://www.openlaszlo.org/jira/browse/LPP-7127">http://www.openlaszlo.org/jira/browse/LPP-7127</a></a></div><div><br></div><div>Subject says it is JS1 problem, but it looks from the end of the description that</div><div>there is also a problem in SWF8?</div><div>Bottom line is both code fragments should work in all runtimes.</div><div><br><div><div>On Oct 6, 2008, at 5:50 AM, P T Withington wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Don, you should probably create a bug for the JS1 back-end to fix this. Right now, when a class is translated to JS1, the initial values for slots are passed as arguments to the class constructor, and hence evaluated in a context before the class is defined. Instead the initial values should be moved into the same context that top-level statements in the class body are evaluated in (which is what the work-around that André describes is doing by hand).<br><br>On 2008-10-05, at 18:27EDT, André Bargull wrote:<br><br><blockquote type="cite">This pattern is used for the service classes: first declaration, then the definition. Works there for swf8 and swf9.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><script when="immediate" ><![CDATA[<br></blockquote><blockquote type="cite"> public class LzQName {<br></blockquote><blockquote type="cite"> static var XSD_STRING;<br></blockquote><blockquote type="cite"> LzQName.XSD_STRING = new LzQName("string", LzNamespace.URI_DEFAULT_SCHEMA_XSD);<br></blockquote><blockquote type="cite"> function LzQName(type:String, uri:String) {<br></blockquote><blockquote type="cite"> }<br></blockquote><blockquote type="cite"> }<br></blockquote><blockquote type="cite">]]></script><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><blockquote type="cite">>/<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">/>/<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">/>/ It should work in both runtimes to just leave out the name of the class,<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">/>/ since static vars are 'in scope' of the class body.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">/>/<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">/<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">OK that works for that case, but there's another case that's causing an<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">error in swf8, which is when the thing tries to instantiate an instance of<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">itself as a static var initializer, e.g.,<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">public class LzQName {<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">static var XSD_STRING =<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"> new LzQName("string", LzNamespace.URI_DEFAULT_SCHEMA_XSD);<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><a title="#75">ERROR @rpc/library/qname.js#130: call to undefined function<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">'LzQName'</a><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><br></blockquote><br><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; "><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-547-7881<br>email: <a href="mailto:dda@ddanderson.com"><a href="mailto:dda@ddanderson.com">dda@ddanderson.com</a></a><br>www: <a href="http://www.ddanderson.com/"><a href="http://www.ddanderson.com">http://www.ddanderson.com</a></a><br></div></div></span></span><br class="Apple-interchange-newline"></div></span></div></span><br class="Apple-interchange-newline"> </div><br></div></div></blockquote></body></html>