JavaScript中函数调用强制使用new


function myClass(){
    try{
        if(  this.__proto__ !== myClass.prototype ){
            throw Error("No New");
        }
    }catch(e){
        console.err(e);
    }
}

评论

暂无评论