Not so much an idea or a proposal as a random thought that just crossed my mind.
Couldn't we go ahead and just drop the TDZ for let?
One one hand you might say, "no this is impossible, that is set in stone now and we can't change it". This may be the truth!
But let's look at the other side:
- The language generally evolves by turning former errors into valid code
- You'd have write a really weird application for happy-path behavior to rely on a TDZ check throwing for correctness. I haven't done the research to be able to say if there are 0 usages of this pattern on the internet, but to the best of my knowledge it's plausible
And then we'd finally have good variables: locally scoped, fast. It wouldn't be table stakes for perf optimization to turn let into var anymore.
const really requires a TDZ check to avoid allowing access to uninitialized constants, so that would stay just how it is. Only let would be affected by this hypothetical change