Browse Source

Add core inheritance functionality

master
Sven Slootweg 9 years ago
commit
bca504ac76
  1. 19
      core.js

19
core.js

@ -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