<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);' , 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. `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. 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. 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. So class types are 'nullable' but not 'undefinedable'. Sounds like you need to say `null` instead of `void 0`. 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> return undefined;</div><div>to:</div><div> return false; // for Boolean types</div><div> return NaN; // for int types (actually this applies to other files, not LzDatapointer)</div><div> return (0 cast ClassName) // for other types</div><div><br></div><div>and I got errors in swf8 smokecheck:</div><div><div><div><br></div><div><div> Tests: 873 Failures: 1 Errors: 0</div><div> TestFailure: >>> testBadDP failed: Undefined: expected 'undefined value' got 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 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> return null;</div><div><br></div><div>Then the error was:</div><div><br></div><div> Tests: 873 Failures: 1 Errors: 0</div><div> TestFailure: >>> testBadDP failed: Undefined: expected 'undefined value' 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> if ($swf8) {</div><div> return undefined;</div><div> }</div><div> else {</div><div> return void 0;</div><div> }</div><div><br></div><div>Yuck. I'm hoping there will be a somewhat unified approach to fixing the dozens of</div><div>return values, this is getting painful. 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: <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><br></div></div></div></body></html>