Javascript 2724 characters
Browser dependent answer (must have access to apply
):
eval.apply(0,Array(999999))
eval
was the shortest global function name that I could find (anyone know of one that is shorter?)apply
allows us to convert an array into function parameters, the first parameter being the context of the function (this
)Array(999999)
will create an array with the listed length. Not sure what the maximum number of arguments is, but it's less than this, and more than99999
IE9:
SCRIPT28: Out of stack space
SCRIPT2343: Stack overflow at line: 20
Chrome 24:
Uncaught RangeError: Maximum call stack size exceeded
FireFox 18
RangeError: arguments array passed to Function.prototype.apply is too large
Note — Due to the single threaded nature of javascript, infinite loops end up locking the UI and never throwing an exception.
while(1);
for(;;);
Neither of these qualify.
Update — this shaves off three characters:
eval.apply(0,Array(1e7))