Add core inheritance functionality

master
Sven Slootweg 12 years ago
commit bca504ac76

@ -0,0 +1,19 @@
Function.prototype.inheritsFrom = function(parentClassOrObject)
{
if ( parentClassOrObject.constructor == Function )
{
//Normal Inheritance
this.prototype = new parentClassOrObject;
this.prototype.constructor = this;
this.prototype.parent = parentClassOrObject.prototype;
}
else
{
//Pure Virtual Inheritance
this.prototype = parentClassOrObject;
this.prototype.constructor = this;
this.prototype.parent = parentClassOrObject;
}
return this;
}
Loading…
Cancel
Save