JSBin
jsbin.com
jsbin.com
This problem is partially solved in the Khan Academy CS editor using a web worker - the code is evaluated in a web worker with most of the side effects stuff mocked out (which is going to be difficult for general javascript) and timed - if it takes more than a couple ms, we kill the execution and give an error. (Try `while (true) {}` in http://www.khanacademy.org/cs/new)
The while problem has been raised before, and there is a tiny bit of protection (we parse the code line you're on, and if its a while loop, it's supposed to ignore live execution - though clearly that's not enough). It's true to say I'm still looking for a solution :)
That all said, you dont lose your work if you hit this kind of loop and it hangs the UI. The reason is two fold: 1) jsbin, since it was released in 2008 always saves code to localStorage, but more importantly, 2) it's saving your code to the server AS YOU TYPE - so you hit refresh, and you get you bin back (and the correct URL and saved in your history if you're signed in, etc).
Everything else, including saving, is available as a non registered and anonymous user.
Does anyone know if there is a way to get the Chrome console to work right, ie. have visibility to all the variables, functions, etc that I create in my fiddle?
It's good for sharing code and helping people though. :)