let/const renaming doesn't accurately reflect the "temporal dead-zone"
Created by: natefaubion
In lastest node:
"use strict";
function foo() {
console.log(a);
}
let a = 12;
foo();
12
In latest sjs:
'use strict';
function foo$274() {
console.log(a);
}
let a$275 = 12;
foo$274();
For let
and const
we just push a new Rename
on to the context of any following syntax (which I suppose would be considered a "lexical window"). I think we can actually just treat it like we treat var
and add it to the definition context, and defer to the runtime to check for the dead-zone.