[[Call]] pass through result completion to callee

Allen Wirfs-Brock allen at wirfs-brock.com
Tue Dec 4 10:15:39 PST 2012

(Note that this is probably the sort of issue that would be better to report to bugs.ecmascript.org)

Yes, that looks like an issue.  It appears to me that the best fix is in the evaluation semantics of FunctionBody.  It should take care of Return completions and also make sure that normal completions yield undefined and not empty.

Letting Return completions escape from functions was needed when we were considering supporting block lambdas but isn't need now.


On Dec 3, 2012, at 11:23 PM, Yusuke Suzuki wrote:

> Hello all,
> Because of step 17, [[Call]] returns result completion even if result.type isn't return.
> As the result, [[Call]] may return NormalCompletion(empty), is it expected behavior?
> I think we should change empty to undefined.
> For example,
> function test() {
>   var i;
> }
> var value = test();  // value is empty...
> -- 
> Regards,
> Yusuke Suzuki
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20121204/5506d211/attachment-0001.html>

More information about the es-discuss mailing list