1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2026-01-06 18:43:46 +00:00

Fixed bug in promise, where an exception was thrown, if a then() returned an already resolved promise.

This commit is contained in:
Bryan Roe
2020-05-29 23:16:43 -07:00
parent 4c143c948b
commit 6e2c9e4a5a
2 changed files with 4 additions and 3 deletions

View File

@@ -137,10 +137,11 @@ function Promise(promiseFunc)
{
var pr = getRootPromise(_resolver._self.promise);
pr._internal._haltUncaught = true;
args[1]._XSLF = _resolver._self;
args[1].then(function ()
{
var parms = ['resolved'];
for(var ai in arguments)
for (var ai in arguments)
{
parms.push(arguments[ai]);
}
@@ -153,7 +154,7 @@ function Promise(promiseFunc)
this._XSLF.promise.__childPromise._rej(e);
//var parms = ['rejected', e];
//this._XSLF.emit.apply(this._XSLF, parms);
}).parentPromise._XSLF = _resolver._self;
});
}
else
{