When removing locals from all scopes, upvalues need to be considered, like in uc_compiler_leave_scope. Otherwise, the following testcase returns the wrong value:
let dest;
for (let i in [ 1 ]) {
let foo = i;
dest = () => {
warn(`value: ${foo}\n`);
};
continue;
}
dest();
// returns value: null instead of value: 1
When removing locals from all scopes, upvalues need to be considered, like in uc_compiler_leave_scope. Otherwise, the following testcase returns the wrong value: