SOURCE

function Class(){
    
    this.extend = function({initialize,members,props}){
        var _this = this;
        var newClass = function(){
            initialize && initialize();
 
            

            //实例成员都复制过来 
            // var m = Object.getOwnPropertyNames(_this);
            // m.forEach(item=>{
            //     this[item] = _this[item]
            // }) 

            for(var i in members){
                this[i] = members[i];
            }


            this.extend = _this.extend;
            
        } 
        console.log(this.__proto__);

        //只继承原型成员
        newClass.prototype = {
            ...this.__proto__,
            ...props
        };

        return newClass;
    }

    this.classF = function(){

    }
}

Class.prototype.classProtoF = function(){
    console.log('classF')
} 



// var ClassFun = new Class();

var A = new Class().extend({
    members:{  //实例成员
        a:1,
        b:2
    },
    initialize:function(){
        console.log('执行A类构造函数')
    },
    props:{  //原型成员
        a_proptotype_f(){ 
        }
    } 
});

console.log(A);
// console.log('A类的实例')
var a = new A();
console.log(a)




var B = new A().extend({
    members:{
        s1:1,
        b:3
    },
    initialize:function(){
        console.log('执行B类的构造函数')
    },
    props:{
        b_proptotype_f(){

        }
    }
})
console.log('B类')
console.log(B)
console.log(new B())
console 命令行工具 X clear

                    
>
console