﻿﻿//A Simple JavaScript Single Inheritance Framework
//As for IE, only IE9(inclusive)+ versions are supported by this library
//@Author: Sky Feng(im.sky@foxmail.com), MIT Licensed.
//      var derived = new Class(/*parentClass, mixins...*/);
//      var derived = Class(/*parentClass, mixins...*/);
//      var derived = Class.extend(/*parentClass, mixins...*/);
(function (name, global, factory) {
    if (typeof define === "function" && define.amd) define(factory);
    else if (typeof module === "object") module.exports = factory();
    //uncomment this line if not support re-entry or duplicates
    //else if (global[name]) throw new Error("Class already loaded!");
    else global[name] = global[name] || factory();
})("Class", this, function () {
    function Class(parentClass/*, mixins...*/) {
        return Class.extend.apply(Class, arguments);
    }
    var mergeSingleProperty = function (target, propName, source) {
        var descriptor = Object.getOwnPropertyDescriptor(source, propName);
        if (descriptor && descriptor.enumerable) {
            descriptor.configurable = descriptor.writable = true;
            Object.defineProperty(target, propName, descriptor);
        }
    };
    var mergeSourceProperties = function privateMerge(derived, mixin) {
        var mixinIsFunction = typeof mixin === "function";
        var protoProps = (mixinIsFunction ? mixin.prototype : mixin) || {};
        Object.getOwnPropertyNames(protoProps).forEach(function (propName) {
            if (typeof protoProps[propName] !== "function") return true;
            if (propName === "initialize" && mixinIsFunction) return true;
            mergeSingleProperty(derived.prototype, propName, protoProps);
        });
    };
    var runParentInitializers = function (thisInstance, thisClass, args) {
        var allParentClasses = [], thisParentClass = thisClass.parent;
        for (; thisParentClass; thisParentClass = thisParentClass.parent)
            allParentClasses.push(thisParentClass);
        allParentClasses.reverse().forEach(function (thisParentClass, i) {
            thisParentClass.prototype.initialize.apply(thisInstance, args);
        });
    };
    var defaultClassInitializer = function defaultClassInitializer() { };
    Class.extend = function (parentClass/*, mixins...*/) {
        var childClass = function childClassConstructor() {
            var childInstance = Object.create(childClass.prototype);
            runParentInitializers(childInstance, childClass, arguments);
            childClass.prototype.initialize.apply(childInstance, arguments);
            return Object.freeze(childInstance);
        };
        if (typeof parentClass === "function") {
            childClass.prototype = Object.create(parentClass.prototype);
            childClass.parent = Object.freeze(parentClass/*immutable*/);
        }
        childClass.prototype.initialize = defaultClassInitializer;
        for (var dpdtIndex = 0; dpdtIndex < arguments.length; dpdtIndex++)
            mergeSourceProperties(childClass, arguments[dpdtIndex]);

        return childClass = Object.freeze(childClass);
    };
    return Object.freeze(Class/*immutable*/);
});
@@ -715,16 +715,35 @@
 ctory();
+ //use existing one
 %0A%7D)(%22Cla
@@ -2991,16 +2991,18 @@
 length; 
+++
 dpdtInde
@@ -3002,18 +3002,16 @@
 pdtIndex
-++
 )%0A      
@@ -3073,16 +3073,24 @@
 ndex%5D);%0A
+        
 %0A       
@@ -3193,8 +3193,9 @@
 */);%0A%7D);
+%0A

Format code in Sky.Class.js