Stop overwriting the static methods
This commit is contained in:
parent
ec7f79e935
commit
275bb6ffac
|
@ -154,7 +154,7 @@ ModelBuilder.prototype.define = function defineClass(className, properties, sett
|
|||
var events = new EventEmitter();
|
||||
for (var f in EventEmitter.prototype) {
|
||||
if (typeof EventEmitter.prototype[f] === 'function') {
|
||||
ModelClass[f] = events[f].bind(events);
|
||||
ModelClass[f] = EventEmitter.prototype[f].bind(events);
|
||||
}
|
||||
}
|
||||
util.inherits(ModelClass, ModelBaseClass);
|
||||
|
@ -178,9 +178,10 @@ ModelBuilder.prototype.define = function defineClass(className, properties, sett
|
|||
|
||||
// inherit ModelBaseClass static methods
|
||||
for (var i in ModelBaseClass) {
|
||||
if(i !== '_mixins') {
|
||||
ModelClass[i] = ModelBaseClass[i];
|
||||
}
|
||||
// We need to skip properties that are already in the subclass, for example, the event emitter methods
|
||||
if(i !== '_mixins' && !(i in ModelClass)) {
|
||||
ModelClass[i] = ModelBaseClass[i];
|
||||
}
|
||||
}
|
||||
|
||||
ModelClass.getter = {};
|
||||
|
|
Loading…
Reference in New Issue