Displaying 1 result from an estimated 1 matches for "ctorstyle".
Did you mean:
comstyle
2005 Sep 25
1
Prototype "classes" and inheritance
..., but I''m
not sure they are compatible with 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 (ct...