From 9d8869cd3363ab35248910ae3f2b9a2a60f25776 Mon Sep 17 00:00:00 2001 From: aurimasv Date: Mon, 14 Jan 2013 00:31:00 -0600 Subject: [PATCH] [Utilities] Deep copy `null` as `null`. Display object type in varDump --- chrome/content/zotero/xpcom/utilities.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/xpcom/utilities.js b/chrome/content/zotero/xpcom/utilities.js index 129b7c718..2588028b8 100644 --- a/chrome/content/zotero/xpcom/utilities.js +++ b/chrome/content/zotero/xpcom/utilities.js @@ -914,7 +914,7 @@ Zotero.Utilities = { for(var i in obj) { if(!obj.hasOwnProperty(i)) continue; - if(typeof obj[i] === "object") { + if(typeof obj[i] === "object" && obj[i] !== null) { obj2[i] = Zotero.Utilities.deepCopy(obj[i]); } else { obj2[i] = obj[i]; @@ -1139,7 +1139,7 @@ Zotero.Utilities = { closeBrace = ']'; } - dumped_text += level_padding + "'" + item + "' => " + openBrace; + dumped_text += level_padding + "'" + item + "' => " + type + ' ' + openBrace; //only recurse if there's anything in the object, purely cosmetical try { for(var i in value) {