function f(){}; f.prototype.toString=function(){ alert(this) }; var p=new f(); p.toString();这个会报错 Uncaught RangeError: Maximum call stack size exceeded at f.toString (%E5%BC%B9%E5%87%BAthis.html:11) at f.toString (%E5%BC%B9%E5%87%BAthis.html:11) at f.toString (%E5%BC%B9%E5%87%BAthis.html:11) at f.toString (%E5%BC%B9%E5%87%BAthis.html:11) at f.toString (%E5%BC%B9%E5%87%BAthis.html:11) at f.toString (%E5%BC%B9%E5%87%BAthis.html:11) at f.toString (%E5%BC%B9%E5%87%BAthis.html:11) at f.toString (%E5%BC%B9%E5%87%BAthis.html:11) at f.toString (%E5%BC%B9%E5%87%BAthis.html:11) at f.toString (%E5%BC%B9%E5%87%BAthis.html:11)把tostring改下名就可以运行了,这是为什么
添加回答
举报
0/150
提交
取消