Code style and attribution fixes

master
Sven Slootweg 12 years ago
parent 625e680367
commit cac6c521ea

@ -1,18 +1,19 @@
Function.prototype.inheritsFrom = function(parentClassOrObject) /* Thanks to http://phrogz.net/js/classes/OOPinJS2.html */
Function.prototype.inheritsFrom = function(parentObject)
{ {
if ( parentClassOrObject.constructor == Function ) if(parentClassOrObject.constructor == Function)
{ {
//Normal Inheritance /* Normal Inheritance */
this.prototype = new parentClassOrObject; this.prototype = new parentObject;
this.prototype.constructor = this; this.prototype.constructor = this;
this.prototype.parent = parentClassOrObject.prototype; this.prototype.parent = parentObject.prototype;
} }
else else
{ {
//Pure Virtual Inheritance /* Pure Virtual Inheritance */
this.prototype = parentClassOrObject; this.prototype = parentObject;
this.prototype.constructor = this; this.prototype.constructor = this;
this.prototype.parent = parentClassOrObject; this.prototype.parent = parentObject;
} }
return this; return this;

Loading…
Cancel
Save