开发者

Firefox 5 - infinite loop handling

开发者 https://www.devze.com 2023-03-18 16:14 出处:网络
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.

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, an开发者_开发技巧d 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.

Firefox 5 - infinite loop handling


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号