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();
|
var events = new EventEmitter();
|
||||||
for (var f in EventEmitter.prototype) {
|
for (var f in EventEmitter.prototype) {
|
||||||
if (typeof EventEmitter.prototype[f] === 'function') {
|
if (typeof EventEmitter.prototype[f] === 'function') {
|
||||||
ModelClass[f] = events[f].bind(events);
|
ModelClass[f] = EventEmitter.prototype[f].bind(events);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
util.inherits(ModelClass, ModelBaseClass);
|
util.inherits(ModelClass, ModelBaseClass);
|
||||||
|
@ -178,9 +178,10 @@ ModelBuilder.prototype.define = function defineClass(className, properties, sett
|
||||||
|
|
||||||
// inherit ModelBaseClass static methods
|
// inherit ModelBaseClass static methods
|
||||||
for (var i in ModelBaseClass) {
|
for (var i in ModelBaseClass) {
|
||||||
if(i !== '_mixins') {
|
// We need to skip properties that are already in the subclass, for example, the event emitter methods
|
||||||
ModelClass[i] = ModelBaseClass[i];
|
if(i !== '_mixins' && !(i in ModelClass)) {
|
||||||
}
|
ModelClass[i] = ModelBaseClass[i];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ModelClass.getter = {};
|
ModelClass.getter = {};
|
||||||
|
|
Loading…
Reference in New Issue