The problem I'm seeing is that if during declaring a variable with let something throws - that identifier is "taken", but I can't use it.
Essentially like this (stripped unnecessary stack).
let broken = JSON.parse('I am broken');
> SyntaxError: Unexpected token I
let broken = 5;
> TypeError: Identifier 'broken' has already been declared
let broken = 5;
> TypeError: Identifier 'broken' has already been declared
I'm seeing this for a long time, but never took an effort to look into it more.
Now I'm curious - is this expected behaviour? Why? If not, how can one go about and fix it?
It's on Node 5 and latest 6, but I believe I've seen it on older versions as well.
[zlatko@zlatko-desktop ~/tmp]$ node -v
v5.12.0
[zlatko@zlatko-desktop ~/tmp]$ uname -a
Linux zlatko-desktop 4.4.0-36-generic #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux