jashkenas/coffee-script — Issue #1980: TypeError: Cannot call method 'push' of undefined
Author: jayzes
Created: 2011-12-28 00:35:42+00:00
State: open

Ran into this one today after upgrading a project to 1.2.0 in an attempt to fix a bug caused by #1464. Now I'm seeing a different issue, and I'm trying to figure out if it's a bug or if my understanding of expected functionality is incorrect. Here's the scenario - say I have two classes, one of which extends the other, and a class method on the child class that I want to bind:

class Hello
end

class World extends Hello
@doSomething: =>

Trying to compile this throws the "Cannot call method 'push' of undefined" exception, though to be honest I can't quite figure out what that means. If I change the doSomething function to not be bound, or the World class not to extend Hello, the code compiles just fine (though obviously it doesn't function as expected).

I can work around the #1464 issue by changing my code and using coffeescript 1.1.3, but the TypeError seems to be a new error in 1.2.0. I didn't see any existing issues that seemed to be the same problem. Sort of stumped on how to proceed - can anyone shed some light?