super return

Steve Fink sphink at
Thu Aug 31 01:01:15 UTC 2017

On 08/29/2017 08:56 AM, Allen Wirfs-Brock wrote:
>> On Aug 28, 2017, at 12:29 PM, Sebastian Malton <sebastian at 
>> <mailto:sebastian at>> wrote:
>> The outcome of this basically means "return from current context up 
>> one level and then return from there”.
> This would be a terrible violation of functional encapsulation.  How 
> do you know that the (e.g.) forOf function isn’t internally using a 
> encapsulated helper function that is making the actual call to the 
> call back.  You simply have no way to predict where returning from the 
> current context “up one” means.
I agree. I think this would be much better as

function someThing(doWith) {
return => {
         return elem * 2;

     come from typeCheckLabel if (typeof elem !== "number");
return "Not all are numbers" ;


(I agree with the encapsulation argument.)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list