Closed meetwudi closed 10 years ago
These engines are not up to spec. The condition you state is an error condition, regardless of v8 not being compliant yet.
Thanks!
Wasn't let
removed from the spec some time ago? Remember seeing a talk by @getify about it.
@yoshuawuyts let is still in the spec
I know what @yoshuawuyts is probably talking about.
I mention in my "New Rules For JS" talk (as well as my "YDKJS: Scope & Closures" book) that the let (x = ..) { .. }
(aka "let statement") form of let
was not added to the ES6 spec, which is true. However, the let x = ..
(aka "let declaration") form of let
_WAS_ added to the ES6 spec.
As far as I can tell, @nzakas is only covering the standardized "let declaration" form in his book, so everything he's said is accurate.
That is correct. I'm covering what should work based on the current state of the spec.
In the Let declarations part, you mentioned that if I declared a variable with
var
and then redeclare it withlet
, it will raise error. But actually it doesn't. I ran the following code in latest v8 (harmony mode), which turned out to be just fine.What will actually raise the error is declaring two variables with same name with
let
in the same scope. For example: