Please sign in to comment.
Allow users to set the pretty-printer's recursion depth
Currently, jasmine's pretty printer traverses objects to 40 levels of nesting. If an object is more deeply nested than that, an exception is thrown. I find that after a few levels of nesting, the output becomes difficult to read. The process of serializing such deep objects also sometimes crashes the browser or causes a 'slow script' warning. This commit exposes a 'MAX_PRETTY_PRINT_DEPTH' option. It also causes the pretty printer to skip over parts of an object that are nested to deeply by simply printing out 'Object' or 'Array', rather than throwing an exception.
- Loading branch information...
Showing with 37 additions and 4 deletions.