标签:amp color handler var span new ret typeof lse
;(function(){ var test=function(){ var tem={}; tem.a=1; return tem; } var r=new test();//{a:1} console.log(r); console.log(r.__proto__===test.prototype);false; test=function(){ var me=this; me.a=1; return function(){} } r=new test(); console.log(r.__proto__===test.prototype);//true var myNew=function(handler){ var tem={}; tem.__proto__=handler.prototype; if(typeof handler.call(tem)!=="object"&&handler.call(tem)!=="function") return tem; return handler.call(tem); } })()
标签:amp color handler var span new ret typeof lse
原文地址:https://www.cnblogs.com/me-data/p/9865359.html