JavaScript中函数调用强制使用new

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