jahcode.js
function() {
            var objectDescriptor = arguments[arguments.length - 1];
            var klass = objectDescriptor.constructor !== Object? objectDescriptor.constructor: function Class(toCast) {
                if (!(this instanceof klass)) {
                    return klass.asInstance(toCast);
                }

                if (this.initialize)
                    arguments.length ? this.initialize.apply(this, arguments) : this.initialize();
            };

            var proto = Object.createPrototypeChain(klass, this, Array.prototype.slice.call(arguments, 0, arguments.length - 1));

            var names = Object.getOwnPropertyNames(objectDescriptor);
            for ( var i = 0; i < names.length; ++i) {
                var name = names[i];
                var result = false;
                if (Object.properties.hasOwnProperty(name)) {
                    result = Object.properties[name](proto, objectDescriptor, name);
                }

                if (!result) {
                    var d = Object.getOwnPropertyDescriptor(objectDescriptor, name);

                    if (d.value) {
                        var val = d.value;
                        if (val instanceof Function) {
                            if (/this\.superCall/.test(val.toString())) {
                                d.value = Object.createSuperCallWrapper(klass, name, val);
                            }
                        } else if (val && (val.hasOwnProperty('get') || val.hasOwnProperty('value'))) {
                            d = val;
                        }
                    }

                    Object.defineProperty(proto, name, d);
                }
            }

            if (klass.initialize) {
                klass.initialize();
            }

            return klass;
        }
function() {
            var objectDescriptor = arguments[arguments.length - 1];
            var klass = objectDescriptor.constructor !== Object? objectDescriptor.constructor: function Class(toCast) {
                if (!(this instanceof klass)) {
                    return klass.asInstance(toCast);
                }

                if (this.initialize)
                    arguments.length ? this.initialize.apply(this, arguments) : this.initialize();
            };

            var proto = Object.createPrototypeChain(klass, this, Array.prototype.slice.call(arguments, 0, arguments.length - 1));

            var names = Object.getOwnPropertyNames(objectDescriptor);
            for ( var i = 0; i < names.length; ++i) {
                var name = names[i];
                var result = false;
                if (Object.properties.hasOwnProperty(name)) {
                    result = Object.properties[name](proto, objectDescriptor, name);
                }

                if (!result) {
                    var d = Object.getOwnPropertyDescriptor(objectDescriptor, name);

                    if (d.value) {
                        var val = d.value;
                        if (val instanceof Function) {
                            if (/this\.superCall/.test(val.toString())) {
                                d.value = Object.createSuperCallWrapper(klass, name, val);
                            }
                        } else if (val && (val.hasOwnProperty('get') || val.hasOwnProperty('value'))) {
                            d = val;
                        }
                    }

                    Object.defineProperty(proto, name, d);
                }
            }

            if (klass.initialize) {
                klass.initialize();
            }

            return klass;
        }
function ( ) { var objectDescriptor = arguments [ arguments . length - 1 ] ; var klass = objectDescriptor . constructor !== Object ? objectDescriptor . constructor : function Class ( toCast ) { if ( ! ( this instanceof klass ) ) { return klass . asInstance ( toCast ) ; } if ( this . initialize ) arguments . length ? this . initialize . apply ( this , arguments ) : this . initialize ( ) ; } ; var proto = Object . createPrototypeChain ( klass , this , Array . prototype . slice . call ( arguments , 0 , arguments . length - 1 ) ) ; var names = Object . getOwnPropertyNames ( objectDescriptor ) ; for ( var i = 0 ; i < names . length ; ++ i ) { var name = names [ i ] ; var result = false ; if ( Object . properties . hasOwnProperty ( name ) ) { result = Object . properties [ name ] ( proto , objectDescriptor , name ) ; } if ( ! result ) { var d = Object . getOwnPropertyDescriptor ( objectDescriptor , name ) ; if ( d . value ) { var val = d . value ; if ( val instanceof Function ) { if ( / this\.superCall / . test ( val . toString ( ) ) ) { d . value = Object . createSuperCallWrapper ( klass , name , val ) ; } } else if ( val && ( val . hasOwnProperty ( 'get' ) || val . hasOwnProperty ( 'value' ) ) ) { d = val ; } } Object . defineProperty ( proto , name , d ) ; } } if ( klass . initialize ) { klass . initialize ( ) ; } return klass ; }
Inherits this constructor and extends it by additional properties and methods. Optional there can be mixined
additional Traits
@param {Trait...} traits Additional traits to mixin
@param {Object} classDescriptor The descriptor of the class properties and methods
@returns {Function} The new created child class
Inherits this constructor and extends it by additional properties and methods . Optional there can be mixined additional Traits