Did finally pass correct value when `onFinally` isn't a function?
manyuemeiquqi opened this issue · comments
manyuemeiquqi commented
When i view this line finally, i confused this case
new Promise((resolve, reject) => {
resolve("1");
})
.finally(2)
.then((res) => {
console.log("res: ", res);
});
finally should return value or reason whether the onFinally
is a function or not
Should replace
return promiseResolve(C, onFinally()).then(function () { return x; }); } : onFinally,
with
return this.then( isFunction ? function (x) { return promiseResolve(C, onFinally()).then(function () { return x; }); } : x,
Denis Pushkarev commented