maxtaco / coffee-script

IcedCoffeeScript
http://maxtaco.github.com/coffee-script
MIT License
727 stars 58 forks source link

Unexpected error with ?= #103

Closed Artazor closed 10 years ago

Artazor commented 10 years ago

Hi, I've found that the following piece of code produces an error:

test = (cb) ->
   await someFn defer res
   res ?= 1
   cb(res)

ERROR: THE VARIABLE "RES" CAN'T BE ASSIGNED WITH ?= BECAUSE IT HAS NOT BEEN DECLARED BEFORE

I guess this is one of edge cases that should be checked. Or I'm missing something?

Artazor commented 10 years ago

Sorry, duplicate of #50