News for hackers. Stuff that matters.
Re:A spreadsheet in fewer than 30 lines of JavaScript, no li... by jcampbell1 on Wednesday November 13, 2013 @11:13AM (#6726127)
I am a bit lost as to why cycles are handled the way they are. Part of the problem, is cycles seem to crash chrome's developer tools.

If you put =A1 in A1, and =A2 in A2, it crashes the web inspector for me.

I am lost as to why putting =A1 in A1 doesn't cause an infinite loop. Why doesn't eval (DATA.A1) not trigger the getter and hence an infinite loop?

Re:A spreadsheet in fewer than 30 lines of JavaScript, no li... by btown on Wednesday November 13, 2013 @06:27PM (#6729404)
It's possible that the call stack is being exceeded, but the Web Inspector is still trying to display each portion of the call stack - leading to an out-of-memory condition for the inspector?
Re:A spreadsheet in fewer than 30 lines of JavaScript, no li... by ondras on Wednesday November 13, 2013 @11:24AM (#6726240)
The getter impl should prevent this. Firefox, for instance, throws an exception...
Re:A spreadsheet in fewer than 30 lines of JavaScript, no li... by jcampbell1 on Wednesday November 13, 2013 @11:32AM (#6726304)
I think I figured it out. It does cause an infinite loop, but Chrome throws a "Range Error: Max Call Stack Exceeded", which then gets trapped by the try/catch block.

Firefox does a similar thing, by throwing a "too much recursion" error.