I would be super surprised if I could use `var` everywhere _except_ async 
iteration. 

So I'd say consistency triumphs. Same reason all the ES2015 features exist in 
non-strict mode.

Also, you might want to look at the async/await pep for why Python has added 
async iteration in 3.5

> On 14 Mar 2016, at 20:29, John Lenz <concavel...@gmail.com> wrote:
> 
> 
> On Mon, Mar 14, 2016 at 11:19 AM, Kevin Smith <zenpars...@gmail.com> wrote:
>>> Is there a summary of the motivation for "for-await" and "async iteration" 
>>> in general? 
>> 
>> There's a short section at: 
>> https://github.com/tc39/proposal-async-iteration#overview-and-motivation
> 
> Thanks
>  
>>  
>>> Has there any discussion in not supporting "var" in "for-await" 
>>> initializers?
>> 
>> Symmetry with for-of is definitely an important consideration.  Is there a 
>> particular reason why you think "var" should be disallowed?
>> 
> 
> There is not a backward compatibility concern and "var" is a smell for all 
> the reasons that "let" was introduced (per-interation bindings don't happen, 
> it isn't scoped to the block).  (I'm unclear why "for-of" allows "var" for 
> the same reason).     I'm not convinced 100% either way, I was just wondering 
> if it was discussed.
>  
> 
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to