Closed callumacrae closed 10 years ago
Thanks, @callumacrae, but I cannot reproduce the error you describe. I am on Firefox Nightly 30.0a1. I am getting what seems to be an error in all the browsers am I using though, in which it is outputting '10 0', '10 1', '10 2', etc.
The expected output is '0 0', '1 1', '2 2', '3 3', etc., correct? I will look into this a bit, but I believe it has something to do with how Traceur has implemented let.
Output from Firefox nightly, and from what I understand from the spec it is correct:
10 11
10 11
10 11
10 11
10 11
10 11
10 11
10 11
10 11
10 11
10 11
Output on ES6 Fiddle:
10 0
10 1
10 2
10 3
10 4
10 5
10 6
10 7
10 8
10 9
10 10
I am pretty sure it is an ES6 to ES5 issue from Traceur; trying to emulate block scoping in ES5 gets pretty weird.
It might be worth noting that the following page claims Firefox's current implementation is not compliant: https://developer.mozilla.org/en-US/docs/Web/JavaScript/ECMAScript_6_support_in_Mozilla
I do see why you would expect all '10 11' though.
Alright. I'll wait for a standard-compliant browser, and see if the output is different still.
http://www.es6fiddle.net/hrw2ntm9/
Running the code in Firefox Nightly causes "10 11" to be output to the console 11 times.