-
Notifications
You must be signed in to change notification settings - Fork 30
Open
Description
I don't know if this is expected behavior or not, but at least it was unexpected (and undesired) for me. The behavior should be changed or clarified in the documentation.
Although my.Class inherits methods and properties fine, the constructor is skipped, defaulting to an empty function in all cases.
This is due to this code:
if (body.constructor === Object) {
Class = function() {};
} else {
Class = body.constructor;
delete body.constructor;
}
To get constructor inheritance I changed that into this code:
if (body.constructor === Object) {
if (SuperClass === null) {
Class = function() { };
} else {
Class = function() {
SuperClass.apply(this, arguments);
};
}
} else {
Class = body.constructor;
delete body.constructor;
}
Metadata
Metadata
Assignees
Labels
No labels