1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2025-12-15 07:43:50 +00:00

Updated to support older agents

This commit is contained in:
Bryan Roe
2021-07-22 16:36:25 -07:00
parent eaa948f184
commit ad961128a2
2 changed files with 34 additions and 12 deletions

File diff suppressed because one or more lines are too long

View File

@@ -109,8 +109,8 @@ function Promise(promiseFunc)
{
this.emit_returnValue('resolved', r);
}
this.removeAllListeners('resolved');
this.removeAllListeners('rejected');
try { this.removeAllListeners('resolved'); } catch (x) { }
try { this.removeAllListeners('rejected'); } catch (x) { }
}
//if (eventName == 'rejected' && (eventCallback.internal == null || eventCallback.internal == false))
@@ -133,8 +133,8 @@ function Promise(promiseFunc)
if (eventName == 'rejected' && this.errors && this.completed)
{
eventCallback.apply(this, this.completedArgs);
this.removeAllListeners('resolved');
this.removeAllListeners('rejected');
try { this.removeAllListeners('resolved'); } catch (x) { }
try { this.removeAllListeners('rejected'); } catch (x) { }
}
if (eventName == 'settled' && this.completed)
{
@@ -300,8 +300,8 @@ function Promise(promiseFunc)
delete this._up;
delete this.__childPromise;
delete this.promise;
this.removeAllListeners('resolved');
this.removeAllListeners('rejected');
try { this.removeAllListeners('resolved'); } catch (x) { }
try { this.removeAllListeners('rejected'); } catch (x) { }
}).internal);
}