pivotal/jasmine — pull request #323 by mikemoraned (2013-01-24 21:33:39+00:00)
Title: Allow users to set the maximum length of array that the pretty-printer will print out

Currently, jasmine's pretty printer will iterate over an entire array, formatting every element recursively. For very large arrays, this can crash the page, or cause a 'slow script' warning.

This commit exposes a 'MAX_PRETTY_PRINT_ARRAY_LENGTH' option. If an array larger than this is encountered, recursion will stop and the array length will be printed instead e.g. "Array[20000000]".

The 'MAX_PRETTY_PRINT_ARRAY_LENGTH' option defaults to 100. This length of array will not kill your browser, but will allow you to see big arrays, if you can stomach the output.