From c74af1d900207af05a623839822262f0bff3d891 Mon Sep 17 00:00:00 2001 From: Steve Gravrock Date: Tue, 12 Dec 2017 08:39:07 -0800 Subject: [PATCH] Reduced pretty printer limits to much smaller values This should help prevent out of memory errors when printing large object graphs. See #1291 and #1422. [#153257532] --- lib/jasmine-core/jasmine.js | 4 ++-- src/core/base.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/jasmine-core/jasmine.js b/lib/jasmine-core/jasmine.js index 2bf8f793..842cbb97 100644 --- a/lib/jasmine-core/jasmine.js +++ b/lib/jasmine-core/jasmine.js @@ -138,14 +138,14 @@ getJasmineRequireObj().base = function(j$, jasmineGlobal) { * Set this to a lower value to speed up pretty printing if you have large objects. * @name jasmine.MAX_PRETTY_PRINT_DEPTH */ - j$.MAX_PRETTY_PRINT_DEPTH = 40; + j$.MAX_PRETTY_PRINT_DEPTH = 8; /** * Maximum number of array elements to display when pretty printing objects. * This will also limit the number of keys and values displayed for an object. * Elements past this number will be ellipised. * @name jasmine.MAX_PRETTY_PRINT_ARRAY_LENGTH */ - j$.MAX_PRETTY_PRINT_ARRAY_LENGTH = 100; + j$.MAX_PRETTY_PRINT_ARRAY_LENGTH = 50; /** * Default number of milliseconds Jasmine will wait for an asynchronous spec to complete. * @name jasmine.DEFAULT_TIMEOUT_INTERVAL diff --git a/src/core/base.js b/src/core/base.js index ea09cb34..28bb1dbb 100644 --- a/src/core/base.js +++ b/src/core/base.js @@ -8,14 +8,14 @@ getJasmineRequireObj().base = function(j$, jasmineGlobal) { * Set this to a lower value to speed up pretty printing if you have large objects. * @name jasmine.MAX_PRETTY_PRINT_DEPTH */ - j$.MAX_PRETTY_PRINT_DEPTH = 40; + j$.MAX_PRETTY_PRINT_DEPTH = 8; /** * Maximum number of array elements to display when pretty printing objects. * This will also limit the number of keys and values displayed for an object. * Elements past this number will be ellipised. * @name jasmine.MAX_PRETTY_PRINT_ARRAY_LENGTH */ - j$.MAX_PRETTY_PRINT_ARRAY_LENGTH = 100; + j$.MAX_PRETTY_PRINT_ARRAY_LENGTH = 50; /** * Default number of milliseconds Jasmine will wait for an asynchronous spec to complete. * @name jasmine.DEFAULT_TIMEOUT_INTERVAL