From 4082ff9e8c07e7873e12677dc28e330e16bc566b Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sat, 12 Nov 2016 22:06:19 -0500 Subject: [PATCH] Simplify assignment of init options --- chrome/content/zotero/xpcom/zotero.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js index 67642d06ec..4818bacf4f 100644 --- a/chrome/content/zotero/xpcom/zotero.js +++ b/chrome/content/zotero/xpcom/zotero.js @@ -176,9 +176,12 @@ Components.utils.import("resource://gre/modules/osfile.jsm"); Zotero.Debug.init(options && options.forceDebugLog); if (options) { - if (options.openPane) this.openPane = true; - if (options.automatedTest) this.automatedTest = true; - if (options.skipBundledFiles) this.skipBundledFiles = true; + let opts = [ + 'openPane', + 'automatedTest', + 'skipBundledFiles' + ]; + opts.filter(opt => options[opt]).forEach(opt => this[opt] = true); } this.mainThread = Services.tm.mainThread;