Created
August 14, 2008 04:47
-
-
Save speedmax/5369 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Class = new Native({ | |
name: 'Class', | |
initialize: function(properties){ | |
properties = properties || {}; | |
var klass = function(){ | |
for (var property in this) this[property] = $unlink(this[property]); | |
this.parent = null; | |
for (var Property in Class.Mutators){ | |
if (!this[Property]) continue; | |
Class.Mutators[Property](this, this[Property]); | |
delete this[Property]; | |
} | |
this.constructor = klass; | |
var self = (arguments[0] !== $empty && this.initialize) ? this.initialize.apply(this, arguments) : this; | |
if (this.options && this.options.initialize) this.options.initialize.call(this); | |
return self; | |
}; | |
$extend(klass, this); | |
klass.constructor = Class; | |
klass.prototype = properties; | |
return klass; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment