michaelficarra / CoffeeScriptRedux

:sweat: rewrite of the CoffeeScript compiler with proper compiler design principles and a focus on robustness and extensibility
https://michaelficarra.github.com/CoffeeScriptRedux/
BSD 3-Clause "New" or "Revised" License
1.84k stars 110 forks source link

Assignment inside iterator scope #347

Open ef4 opened 9 years ago

ef4 commented 9 years ago

This:

for x in myList
  x ?= 1

throws Error: the variable "x" can't be assigned with ?= because it has not been defined.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

ef4 commented 9 years ago

https://github.com/michaelficarra/CoffeeScriptRedux/issues/299 looks like the same bug, although this example is broader -- no destructuring is needed to trigger the bug.