简体   繁体   中英

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).

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

在此处输入图像描述

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM