<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Okay - it's bigger than I have time to do this time. It will be in a JIRA, with a TODO to mark the spot.<div>Thanks.</div><div><br><div><div>On Oct 24, 2008, at 3:46 PM, P T Withington wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>I see. Two different issues.<br><br>1) As André reminded me, we already have a bug, LPP-6884, to fix the (void 0)/undefined issue. That is, we just want `undefined` to be an immutable constant in LZX, like it will be in future Javascripts. It is a bug in JS1 that it is not.<br><br>2) AS3 does not allow you to to return `undefined` from a function that has a subtype of Object as a return type. You either have to return an object of the appropriate type or null. But, at least in the databinding case, it appears from the smoketest that there is a contract to return `undefined` if a datapath matches nothing (or is erroneous). So that says to me (for whatever datapath call is involved in that particular test case) the return type should not be `String`, but must be `*` (or `(String | void)`, if that were permitted), so that you can return `undefined`.<br><br>Until LPP-6884 is fixed, it seems you will have to conditionalize the return on the runtime, although fixing LPP-6884 should be fairly easy. If you look at the class VariableReference, you will see it already tries to head you off from assigning to 'undefined'. We could just go one step further and for the JS1 backends, if you use 'undefined' as an r-value, translate it to (void 0), ensuring that it is a constant. And, while you're there, you might as well handle NaN and Infinity.<br><br>On 2008-10-24, at 15:17EDT, Donald Anderson wrote:<br><br><blockquote type="cite">Well, I'll file a JIRA on this (and the other items), but I'm also confused.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">I could change the String functions in LzDatapointer.lzs to return undefined<br></blockquote><blockquote type="cite">on any new return paths, and revert the smoke testcase.<br></blockquote><blockquote type="cite">This is what I did in the first review. That compiles on all runtimes, and allows<br></blockquote><blockquote type="cite">the tests to pass unchanged. I was under the impression that<br></blockquote><blockquote type="cite">this was not desirable - you said:<br></blockquote><blockquote type="cite"> `undefined` may be undefined in as3, but it is not in js1, so we can't rely on that.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">On the other hand, 'void 0' is not allowed, it gives a SWF9 compilation error.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">- Don<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">On Oct 24, 2008, at 1:33 PM, P T Withington wrote:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><blockquote type="cite">On 2008-10-24, at 13:20EDT, Donald Anderson wrote:<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"> The 'String returns null' case exposed a bug in test/smoke/regression.lzl<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"> where an 'undefined' was expected, changed to a null expected.<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">This is the main change that I think is potentially wrong. I am ok with it as a temporary work-around, but would like a p0 bug to revert the test and find the cuplrit. I think there is a place where you need to relax a return type so you can return (String | void) and return undefined on error.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">IWBNI you also filed Jira's for the other TODO's you mention.<br></blockquote></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-547-7881<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><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">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></body></html>