I spent some time investigating this case. Before Spidermonkey hackers answer in Google Groups thread, I have some thoughts about it and I want to discuss them a bit. First of all, Spidermonkey developers changed the AST generated from this code ```for (let i = 0; i<10; i++) {}```. Old js binaries available with homebrew produce [this AST](https://gist.github.com/1999/8313773#file-old-json) and new binaries produce [this](https://gist.github.com/1999/8313773#file-new-json).

@getify I was wrong yesterday when I agreed with you about special behavior of let in a for loop header. If the variable is ```let```-scoped and defined in ```init``` part of the ```ForStatement``` then it's not block-scoped to **each iteration**, it's rather block-scoped to the condition, update, and body parts of the for loop. Here's the proof of this [on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Scope_Cheatsheet#for_heads).

In fact this link gives the answer to the strange AST produced by the Spidermonkey binaries. The ```ForStatement``` is scoped within a special ```BlockStatement``` and ```let``` declarations hoist to the top of this scope. I dare say Spidermonkey hackers think the produced AST is okay.