function hoisting like var

Lars Hansen lhansen at adobe.com
Fri Jul 25 04:38:12 PDT 2008


Is

  {{ return }}

syntactic sugar for 

  (function() {{ return }})()

too?

--lars

> -----Original Message-----
> From: es4-discuss-bounces at mozilla.org [mailto:es4-discuss-
> bounces at mozilla.org] On Behalf Of Igor Bukanov
> Sent: 25. juli 2008 13:34
> To: waldemar at google.com
> Cc: es3.x-discuss at mozilla.org; es4-discuss at mozilla.org; Ingvar von
> Schoultz
> Subject: Re: function hoisting like var
> 
> I guess that proposal can be summarized in a very short form:
> 
> make
> 
>   {{ code }}
> 
> a syntax sugar for
> 
>   (function() { code })()
> 
> On a few occasions I have used the latter form in ES3 programs to get
> the benefits of the let locals without using the let keyword.
> 
> Regards, Igor
> _______________________________________________
> Es4-discuss mailing list
> Es4-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es4-discuss



More information about the Es4-discuss mailing list