Fix ShardClientUtil#broadcastEval - now really accepting functions (#2248)

* small fix to broadcastEval accepting functions

* dont ignore idea anymore (separate PR then)
This commit is contained in:
pedall
2018-01-14 20:46:08 +01:00
committed by Crawl
parent 351f5f7209
commit 42c0e50c92

View File

@@ -86,7 +86,7 @@ class ShardClientUtil {
*/
broadcastEval(script) {
return new Promise((resolve, reject) => {
script = typeof script !== 'function' ? `(${script})(this)` : script;
script = typeof script === 'function' ? `(${script})(this)` : script;
const listener = message => {
if (!message || message._sEval !== script) return;
process.removeListener('message', listener);