Browse Source

Code style and attribution fixes

master
Sven Slootweg 9 years ago
parent
commit
cac6c521ea
  1. 17
      core.js

17
core.js

@ -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
this.prototype = new parentClassOrObject;
/* Normal Inheritance */
this.prototype = new parentObject;
this.prototype.constructor = this;
this.prototype.parent = parentClassOrObject.prototype;
this.prototype.parent = parentObject.prototype;
}
else
{
//Pure Virtual Inheritance
this.prototype = parentClassOrObject;
/* Pure Virtual Inheritance */
this.prototype = parentObject;
this.prototype.constructor = this;
this.prototype.parent = parentClassOrObject;
this.prototype.parent = parentObject;
}
return this;

Loading…
Cancel
Save