src/n13.js
/**
             * @private
             * Classical inheritance. Adds "self" and "base" properties into the class and connects
             * child and parent classes by prototype inheritance. Also important, that first argument
             * of new operator is always configuration. Example: var cl = new Class({...}, <custom arguments>)
             * @param {Function} parent Parent class
             * @param {Function} child Child class
             * @param {Object} properties Properties sent by second parameter in N13.define method
             * @return {Function} New child class inherited from parent
             */
@private
Classical inheritance. Adds "self" and "base" properties into the class and connects
child and parent classes by prototype inheritance. Also important, that first argument
of new operator is always configuration. Example: var cl = new Class({...}, )
@param {Function} parent Parent class
@param {Function} child Child class
@param {Object} properties Properties sent by second parameter in N13.define method
@return {Function} New child class inherited from parent
@private Classical inheritance . Adds " self " and " base " properties into the class and connects child and parent classes by prototype inheritance . Also important that first argument of new operator is always configuration . Example : var cl = new Class ( { ... } ) @param { Function } parent Parent class @param { Function } child Child class @param { Object } properties Properties sent by second parameter in N13 . define method @return { Function } New child class inherited from parent
function extend(parent, child, properties) {
                var childConstructor = function childConstructor(config) {
                    var ctor = properties.hasOwnProperty('init') ? properties.init : undefined;
                    var c;
                    var cfg;
                    for (c in config) {
                        if (config.hasOwnProperty(c)) {
                            cfg = config[c];
                            if (isFunction(cfg)) {
                                 Name of the property, where we store current function name. It will be used in
                                 callParent() method, which calls same method from parent class.
                                cfg.fn   = c;
                                 Here we must use this.self.base instead child.base
                                cfg.base = this.self.prototype;
                                 Save reference to current class
                                cfg.cl   = this.self.prototype;
                            }
                            this[c] = cfg;
                        }
                    }
                    return (this.init || ctor || parent).apply(this, arguments);
                };
                var childProto;
                var oldProto;
                function F() {}
                F.prototype                            = parent.prototype;
                childConstructor.prototype             = new F();
                childConstructor.prototype.constructor = childConstructor.prototype.self = childConstructor;
                 You can use it for accessing to the parent class. See N13.define() comment for details
                childConstructor.base                  = parent.prototype;
                childProto                             = childConstructor.prototype;
                oldProto                               = child.prototype;
                 All these properties are used for post inheritance and dependency loading. Post inheritance means
                 that inheritance and dependency loading will be started on N13.create() and not in N13.define().
                childProto.className                   = oldProto.className;
                childProto.setConfig                   = oldProto.setConfig;
                childProto.requires                    = oldProto.requires;
                childProto.props                       = oldProto.props;
                childProto.childStr                    = oldProto.childStr;
                childProto.childNs                     = oldProto.childNs;
                childProto.applyProps                  = oldProto.applyProps;
                childProto.inherit                     = oldProto.inherit;
                childProto.parent                      = oldProto.parent || undefined;
                return childConstructor;
            }
function extend ( parent , child , properties ) { var childConstructor = function childConstructor ( config ) { var ctor = properties . hasOwnProperty ( 'init' ) ? properties . init : undefined ; var c ; var cfg ; for ( c in config ) { if ( config . hasOwnProperty ( c ) ) { cfg = config [ c ] ; if ( isFunction ( cfg ) ) { cfg . fn = c ; cfg . base = this . self . prototype ; cfg . cl = this . self . prototype ; } this [ c ] = cfg ; } } return ( this . init || ctor || parent ) . apply ( this , arguments ) ; } ; var childProto ; var oldProto ; function F ( ) { } F . prototype = parent . prototype ; childConstructor . prototype = new F ( ) ; childConstructor . prototype . constructor = childConstructor . prototype . self = childConstructor ; childConstructor . base = parent . prototype ; childProto = childConstructor . prototype ; oldProto = child . prototype ; childProto . className = oldProto . className ; childProto . setConfig = oldProto . setConfig ; childProto . requires = oldProto . requires ; childProto . props = oldProto . props ; childProto . childStr = oldProto . childStr ; childProto . childNs = oldProto . childNs ; childProto . applyProps = oldProto . applyProps ; childProto . inherit = oldProto . inherit ; childProto . parent = oldProto . parent || undefined ; return childConstructor ; }
@private
 Classical inheritance.
@private Classical inheritance .
/**
                 * We need this wrapper for parsing of configuration, which is passed by first
                 * argument in new operator. This configuration will be applied into the instance,
                 * not in prototype. Also, this wrapper calls the constructor function stored in
                 * "init" property.
                 * @param {Object} config Class configuration
                 * @return {Object} Class instance
                 */ // // Name of the property, where we store current function name. It will be used in // callParent() method, which calls same method from parent class. // // // Here we must use this.self.base instead child.base // // // Save reference to current class // // // You can use it for accessing to the parent class. See N13.define() comment for details // // // All these properties are used for post inheritance and dependency loading. Post inheritance means // that inheritance and dependency loading will be started on N13.create() and not in N13.define(). //