Simplify assignment of init options

This commit is contained in:
Dan Stillman 2016-11-12 22:06:19 -05:00
parent 0f19e5c89b
commit 4082ff9e8c

View file

@ -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;