www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 786f5efa3069c5274caf598eb3972a69c27ca79c
parent a017fe6666eb870b622424731a98a2c13da462b5
Author: Dan Stillman <dstillman@zotero.org>
Date:   Tue, 17 Jan 2017 02:31:10 -0500

Add maxDepth as the third argument to Zotero.debug()

varDump(), which is used by Zotero.debug(), defaults to 5

Diffstat:
Mchrome/content/zotero/xpcom/debug.js | 4++--
Mchrome/content/zotero/xpcom/zotero.js | 5+++--
2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/chrome/content/zotero/xpcom/debug.js b/chrome/content/zotero/xpcom/debug.js @@ -82,13 +82,13 @@ Zotero.Debug = new function () { } } - this.log = function (message, level, stack) { + this.log = function (message, level, maxDepth, stack) { if (!this.enabled) { return; } if (typeof message != 'string') { - message = Zotero.Utilities.varDump(message); + message = Zotero.Utilities.varDump(message, 0, maxDepth); } if (!level) { diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js @@ -1031,11 +1031,12 @@ Services.scriptloader.loadSubScript("resource://zotero/polyfill.js"); * * @param {} message * @param {Integer} [level=3] + * @param {Integer} [maxDepth] * @param {Boolean|Integer} [stack] Whether to display the calling stack. * If true, stack is displayed starting from the caller. If an integer, * that many stack levels will be omitted starting from the caller. */ - function debug(message, level, stack) { + function debug(message, level, maxDepth, stack) { // Account for this alias if (stack === true) { stack = 1; @@ -1043,7 +1044,7 @@ Services.scriptloader.loadSubScript("resource://zotero/polyfill.js"); stack++; } - Zotero.Debug.log(message, level, stack); + Zotero.Debug.log(message, level, maxDepth, stack); }