I really like this idea. I took a look at the Javascript output of the compiler, and noticed that effectively every statement of the program would result in a function nested within the function created by the last N statements. Since Javascript doesn't have tail call optimization, the browser will complain at some point when the stack overflows.
Contrived, I know, but it looks like in Firefox 8 that happens at around 39k.