walmartlabs/thorax — pull request #67 by kpdecker (2012-12-16 23:46:34+00:00)
Title: Has plugin

Removes remaining {{has-plugin}} build-time conditionals.

To do this the event handling was updated so the behavior is more like that of the language's prototype implementation. To do this the prototype chain for the events are examined at instantiation time rather than class creation time. This allows for patterns like:

```
var Child = View.extend();
View.on('foo')
new Child();
```

with the child instance picking up the event that was added later. Also in here but not explicitly required to make the other refactorings work is support for inheritance of events defined on the prototype. i.e.

```
var Child = View.extend({
events: {foo: '1'}
}):
var SubChild = Child.extend({
events: {foo: '2'}
});
```

WIll have both 1 and 2 executed when foo is triggered on an instance of SubChild.

This does create a little bit more overhead on view instantiation/data object (un)bind as the prototype tree needs to be walked rather than a single array/object examined but I am doubtful that this is going to be a performance concern outside of cases that have very deep inheritance which should probably be avoided anyway.