From e0ea3ca99bed1d81c545ad571ecaa840a64e7ef3 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 19 May 2015 01:13:35 -0400 Subject: [PATCH] Don't show "[object Object]" in varDump() output --- chrome/content/zotero/xpcom/utilities.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/utilities.js b/chrome/content/zotero/xpcom/utilities.js index 4edb19afc8..feb1393cda 100644 --- a/chrome/content/zotero/xpcom/utilities.js +++ b/chrome/content/zotero/xpcom/utilities.js @@ -1381,7 +1381,15 @@ Zotero.Utilities = { } var isArray = objType == '[object Array]' - var dumpedText = isArray ? '[' : objType + ' {'; + if (isArray) { + var dumpedText = '['; + } + else if (objType == '[object Object]') { + var dumpedText = '{'; + } + else { + var dumpedText = objType + ' {'; + } for (var prop in obj) { dumpedText += '\n' + level_padding + JSON.stringify(prop) + ": ";