
Crash JavaScript and more - mabynogy
http://boards.4chan.org/g/thread/64371898
======
johntran
You're just adding an element to an array infinitely. Of course it'll crash
because you'll run out of memory to support the array.

How is this a bug? What's the expected behavior?

~~~
Jach
Personally I'd want something more graceful like halting JS execution on the
page and some sort of message...

When I was a teen I rudely tricked a friend to load an infinite alert() page,
forcing them to kill their browser and lose some state. These days browsers
don't let alerts block switching tabs or closing the offending tab, and with
too frequent alerts you can check a box to block any more. It's better.

~~~
mr_toad
Chrome doesn't crash, it gives you an error page with the message "Google
chrome ran out of memory while trying to display this web page"

IE11 just gives an OOM error in the console.

------
matmo
The code in question (had to wget from the github referenced below - I'd
rather not visit the domain OP posted at work):

<!DOCTYPE html><html><head><meta charset="utf-8"></head><body><script>

const a=[];

while(true) { a.push(42); }

</script></body></html>

------
mabynogy
Some details and screenshots:
[https://github.com/dailyprog/dailyprog.github.io/blob/master...](https://github.com/dailyprog/dailyprog.github.io/blob/master/readme.md)

------
komali2
This link will be a 404 at any given time in the future...

~~~
yeukhon
Yeah much like the Apple ones. I have a copy of the code though. But seriously
do not play with it....

