Displaying 1 result from an estimated 1 matches for "supermethod".
2005 Sep 25
1
Prototype "classes" and inheritance
...ith the way prototype.js handles classes.
Below is my simplistic implementation for single-level inheritance. See
the unit tests for how it works. I appreciate suggestions for
improvement.
Michael
Object.inherit = function(destination, source, ctorStyle) {
for (property in source) {
var superMethod = destination[property];
if (superMethod && typeof superMethod == ''function'') {
destination[''_super_'' + property] = superMethod;
}
destination[property] = source[property];
}
if (ctorStyle && ctorStyle != ''explicitSu...