commit 4082ff9e8c07e7873e12677dc28e330e16bc566b parent 0f19e5c89b9da03e022385a06ff17df6d02a6132 Author: Dan Stillman <dstillman@zotero.org> Date: Sat, 12 Nov 2016 22:06:19 -0500 Simplify assignment of init options Diffstat:
| M | 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 @@ -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;