Make ConcurrentCaller.js importable in electron
This commit is contained in:
parent
53522c2cbe
commit
d5c2d887a7
1 changed files with 10 additions and 2 deletions
|
@ -24,9 +24,13 @@
|
|||
*/
|
||||
|
||||
EXPORTED_SYMBOLS = ["ConcurrentCaller"];
|
||||
Components.utils.import('resource://zotero/require.js');
|
||||
|
||||
var Promise = require('resource://zotero/bluebird.js');
|
||||
if (!(typeof process === 'object' && process + '' === '[object process]')) {
|
||||
Components.utils.import('resource://zotero/require.js');
|
||||
var Promise = require('resource://zotero/bluebird.js');
|
||||
} else {
|
||||
Promise = require('bluebird');
|
||||
}
|
||||
|
||||
/**
|
||||
* Call a fixed number of functions at once, queueing the rest until slots
|
||||
|
@ -272,3 +276,7 @@ ConcurrentCaller.prototype._log = function (msg) {
|
|||
this._logger("[ConcurrentCaller] " + (this._id ? `[${this._id}] ` : "") + msg);
|
||||
}
|
||||
};
|
||||
|
||||
if (typeof process === 'object' && process + '' === '[object process]'){
|
||||
module.exports = ConcurrentCaller;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue