Don't pass value/reason to promise.finally callback.
This behavior is inline with ES6.
This commit is contained in:
parent
a52c00fb5f
commit
1dc8c31632
1 changed files with 3 additions and 3 deletions
|
|
@ -1056,11 +1056,11 @@ var m = (function app(window, undefined) {
|
|||
};
|
||||
prop["catch"] = prop.then.bind(null, null);
|
||||
prop["finally"] = function(callback) {
|
||||
var _callback = function(value) {return m.deferred().resolve(callback(value)).promise;};
|
||||
var _callback = function() {return m.deferred().resolve(callback()).promise;};
|
||||
return prop.then(function(value) {
|
||||
return propify(_callback(value).then(function() {return value;}), initialValue);
|
||||
return propify(_callback().then(function() {return value;}), initialValue);
|
||||
}, function(reason) {
|
||||
return propify(_callback(reason).then(function() {throw new Error(reason);}), initialValue);
|
||||
return propify(_callback().then(function() {throw new Error(reason);}), initialValue);
|
||||
});
|
||||
};
|
||||
return prop;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue