<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Oct 22, 2008, at 1:10 PM, P T Withington wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>On 2008-10-21, at 17:19EDT, Donald Anderson wrote:<br><br><blockquote type="cite">On Oct 21, 2008, at 2:33 PM, P T Withington wrote:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><blockquote type="cite">On 2008-10-21, at 13:57EDT, Donald Anderson wrote:<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">On Oct 21, 2008, at 1:01 PM, P T Withington wrote:<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">Great stuff!<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">Comments:<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">1) Our idiom for undefined is `void 0`, because of (<a href="http://tinyurl.com/2z3q2o">http://tinyurl.com/2z3q2o</a>),<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">On an existing line with 'return void(0);' &nbsp;, I got a flex error about mismatching type.<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">There are surely plenty of places in our code where we use the idiom `void 0` to mean undefined, so the problem must lie elsewhere. &nbsp;`undefined` may be undefined in as3, but it is not in js1, so we can't rely on that.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">`void` is a unary prefix operator that is defined to evaluate its operand and return the undefined value. &nbsp;If Flex is whining about that, I'd say that's a Flex bug.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">The parens are not necessary because `void` is an operator not a function and 0 and (0) are equivalent expressions. &nbsp;I used 0 as the expression as a nano-optimization (from knowing the byte-codes that get generated).<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">FWIW, here's the error I get if I leave return void(0) in this function:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">[/tmp/lzswf9/lzgen49569/LzReplicationManager.as: 344] data/LzReplicationManager.lzs: 485: Error: Implicit coercion of a value of type void to an unrelated type LzReplicationManager.<br></blockquote><br>Interesting. &nbsp;So class types are 'nullable' but not 'undefinedable'. &nbsp;Sounds like you need to say `null` instead of `void 0`. &nbsp;If we have code that depends on distinguishing between the two, our code sucks.<br></div></blockquote></div><div><br></div>I 'upgraded' all the return values that I inserted in LzDatapointer from<div>&nbsp;&nbsp; return undefined;</div><div>to:</div><div>&nbsp;&nbsp; return false; &nbsp; // for Boolean types</div><div>&nbsp;&nbsp; return NaN; &nbsp; // for int types &nbsp;(actually this applies to other files, not LzDatapointer)</div><div>&nbsp;&nbsp; return (0 cast ClassName) &nbsp;// for other types</div><div><br></div><div>and I got errors in swf8 smokecheck:</div><div><div><div><br></div><div><div>&nbsp;&nbsp;Tests:&nbsp;873&nbsp;Failures:&nbsp;1&nbsp;Errors:&nbsp;0</div><div>&nbsp;&nbsp;TestFailure:&nbsp;&nbsp;>>>&nbsp;testBadDP&nbsp;failed:&nbsp;Undefined:&nbsp;&nbsp;expected&nbsp;'undefined&nbsp;value'&nbsp;got&nbsp;0</div><div><br></div><div apple-content-edited="true"> <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>Some of &nbsp;these return types were String, and thinking that those might return null by default,</div><div>I changed all the String return types to</div><div>&nbsp;&nbsp; &nbsp;return null;</div><div><br></div><div>Then the error was:</div><div><br></div><div>&nbsp;&nbsp;Tests:&nbsp;873&nbsp;Failures:&nbsp;1&nbsp;Errors:&nbsp;0</div><div>&nbsp;&nbsp;TestFailure:&nbsp;&nbsp;>>>&nbsp;testBadDP&nbsp;failed:&nbsp;Undefined:&nbsp;&nbsp;expected&nbsp;'undefined&nbsp;value'&nbsp;got null</div><div><br></div><div>So at least for routines that return String, where they didn't return a value before,</div><div>we must return 'undefined' in order for smokecheck to pass.</div><div><br></div><div>I suppose an alternative is:</div><div>&nbsp;&nbsp;if ($swf8) {</div><div>&nbsp;&nbsp; &nbsp; return undefined;</div><div>&nbsp;&nbsp;}</div><div>&nbsp;&nbsp;else {</div><div>&nbsp;&nbsp; &nbsp; return void 0;</div><div>&nbsp;&nbsp;}</div><div><br></div><div>Yuck. &nbsp;I'm hoping there will be a somewhat unified approach to fixing the dozens of</div><div>return values, this is getting painful. &nbsp;Or is this a case where smokecheck is broken,</div><div>and I should file a Jira on that?</div><div><br></div><div>- Don</div><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:&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><br></div></div></div></body></html>