4 ms·
I wondered how it would handle an infinite loop of javascript alerts, so I wrote a little script to test it: http://www.paulbutler.org/projects/chrome/test.htm
by paulgb 18y ago
I wondered how it would handle an infinite loop of javascript alerts, so I wrote a little script to test it:
http://www.paulbutler.org/projects/chrome/test.html http://www.paulbutler.org/projects/chrome/test.html
It passed! I'd be curious to know how Opera and Safari do on the test. I have a hunch Opera might pass it.
- stcredzero 18y agoIf you want to test the GC in Javascript, try out an infinite loop of unreferenced allocations. Generational GC should be able to handle this without breaking a sweat.
- paulgb 18y agoActually, I wasn't trying to test the javascript VM at all, just how the browser handled an infinite loop of alert dialogs. Since alert windows steal focus, an infinite loop of them will keep stealing focus. I wanted to know how Chrome would handle this.
- stcredzero 18y agoI didn't think you were barking up the wrong tree. It's another suggestion. You might need some kind of "yield" statement if you want to see how another Javascript program will act with a background window spamming it with allocations.
- tocomment 18y agoThat seems to somehow crash my chrome tab after it shows the alert?
- dougp 18y agoOpera has a check box on the alert which allows you to disable scripts. So I guess it passes.