JavaScript中函數調用強制使用new

function myClass(){
    try{
        if(  this.__proto__ !== myClass.prototype ){
            throw Error("No New");
        }
    }catch(e){
        console.err(e);
    }
}
相關文章
相關標籤/搜索