CoffeeScript doesn't allow you to shadow variables in enclosing scopes. The compiler will declare the variable in the "outer-most" scope in which is is used and then any uses in enclosed scopes refer to that one.
In this case as long as OP was not using the variable in an enclosing scope, it would have been made local to the function.