|
|
|
|
|
by MatthewPhillips
5419 days ago
|
|
This is the way JS devs have been hacking inheritance for a long time. That's irrelevant though, we're not comparing CS to Backbone, we're comparing Batman.js to Backbone. Backbone handles the messy inheritance code for you. Batman.js relies on CS for that, but a JS dev is going to have to write the inheritance code by hand. I posted the JS equivalent of their example in this thread, it's nasty. |
|
* A subclass that inherits the parent's implementation of the constructor function, unless overridden.
* A named function for your class object, without IE scope leaks.
* A way to call super that's as easy as `super()`.
* Inheritance of the parent's own properties (unfortunately via copying).
* ... which enables helpful metaprogramming within class bodies. For example, Batman's own `event` decorator: