Aleksandar
Aleksandar

Reputation: 181

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

Upvotes: 0

Views: 586

Answers (2)

Anthony Grist
Anthony Grist

Reputation: 38345

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.

Upvotes: 1

Nalum
Nalum

Reputation: 4213

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

enter image description here

Upvotes: 2

Related Questions