Firefox 5 - 無限循環處理 (Firefox 5 - infinite loop handling)


問題描述

Firefox 5 ‑ 無限循環處理 (Firefox 5 ‑ infinite loop handling)

During recent development I've discovered infinite loop in application I'm working on. First error I got was while using FF4, and later I've done same test in IE8 and FF3.6. Now, even that I've noticed that IE8 is throwing exception (error popup with stop script button) much faster than FF4, the error was always thrown by both browsers for that error.

After upgrading FF4 to FF5 I noticed something that could be quite a problem for developers. FF5 is stopping/breaking infinite loop, and continue to work without noticing the user. I'm not sure if I bump on some weird behavior, and I'd like someone to confirm (before I drop FF5 from my dev tools).

‑‑‑‑‑

參考解法

方法 1:

I've just tried it directly in the bar and got the below warning.

方法 2:

I ran the following script:

<script>

var i = 0, j = 0;
console.log(i);
console.log(j);
while(i < 1) {
    j++;
}
console.log(j);

</script>

in Firefox 5 and got a confirm dialog notifying me of a potential infinite loop, and asking whether or not I wanted to stop the script.

(by AleksandarNalumAnthony Grist)

參考文件

  1. Firefox 5 ‑ infinite loop handling (CC BY‑SA 3.0/4.0)

#Browser #javascript #firefox






相關問題

讓 jQuery 與 Netscape 7 和 8 一起工作 (Getting jQuery to work with Netscape 7 and 8)

功能性 javascript 和網絡瀏覽器 javascript 版本 (Functional javascript and web browser javascript versions)

VB.NET - WebBrowser 附加標題 - 用戶代理覆蓋/取消其他標題? (VB.NET - WebBrowser Additional Headers - User Agent Overrides / Cancels Other Headers?)

無法在所有移動瀏覽器上居中 - 普通瀏覽器效果極佳 (Centering Not Possible On All Mobile Browsers - Normal Browser Works Superb)

在 SWT 瀏覽器小部件中獲取選定文本 (Getting a Selected Text In SWT Browser Widgets)

瀏覽器如何知道網頁發生了變化? (How does the browser know a web page has changed?)

iPhone/Android/BlackBerry 上的 jQuery (jQuery on iPhone/Android/BlackBerry)

對 DOM 和 HTML (API) 之間的關係感到困惑 (Confused by relation between DOM and HTML (APIs))

Firefox 5 - 無限循環處理 (Firefox 5 - infinite loop handling)

字符串或二進制數據將被截斷 (string or binary data would be truncated)

拖放圖片轉Base64 (Drag and drop image convert to Base64)

使用在瀏覽器中運行的 webgl 創建 GPU 密集型 Web 應用程序是否現實? (Is it realistic to create gpu-intensive web apps using webgl running in the browser?)







留言討論