mirror of
https://github.com/Ylianst/MeshAgent
synced 2025-12-15 15:53:55 +00:00
Updated promise, so you can't resolve/reject more than once
This commit is contained in:
@@ -67,6 +67,7 @@ function Promise(promiseFunc)
|
||||
});
|
||||
this._internal.resolver = function _resolver()
|
||||
{
|
||||
if (_resolver._self.completed) { return; }
|
||||
_resolver._self.errors = false;
|
||||
_resolver._self.completed = true;
|
||||
_resolver._self.completedArgs = [];
|
||||
@@ -89,6 +90,7 @@ function Promise(promiseFunc)
|
||||
};
|
||||
this._internal.rejector = function _rejector()
|
||||
{
|
||||
if (_rejector._self.completed) { return; }
|
||||
_rejector._self.errors = true;
|
||||
_rejector._self.completed = true;
|
||||
_rejector._self.completedArgs = [];
|
||||
|
||||
Reference in New Issue
Block a user