Chrome的一个bug? 大家看看

我写了一个很简单的页面:

<html>
<head>
 <script type="text/javascript">
   function fact(x){return x<=1?1:fact(x-1)*x};
   function disp(x){document.write(fact(x));}
 </script>
</head>
<body onload="disp(5)">
</body>
</html>

这个代码在IE和FF下都运行很正常,计算5的阶乘,但是在Chrome下就崩溃了。应该是Chrome的bug吧?

PS: 后来发现不是,详见下文

http://stackoverflow.com/questions/762416/why-isnt-chrome-running-this-javascript 

posted @ 2009-12-01 17:22  yinzixin  阅读(196)  评论(1编辑  收藏  举报