rainforestapp / decaf

Coffeescript to ES.next transpiler. Now maintained over at
https://github.com/juliankrispel/decaf
MIT License
106 stars 10 forks source link

Undefined variables in higher scope are shadowed #146

Closed arty-name closed 8 years ago

arty-name commented 8 years ago

Input:

[x] = []
setTimeout ->
  x = 2

Output:

var [x] = [];

setTimeout(function() {
  var x;
  return x = 2;
});

The inner scope should have reused the x variable from the outer scope.