diff --git a/packages/fbjs/src/__forks__/Promise.native.js b/packages/fbjs/src/__forks__/Promise.native.js index 00ba5059..7f26bf48 100644 --- a/packages/fbjs/src/__forks__/Promise.native.js +++ b/packages/fbjs/src/__forks__/Promise.native.js @@ -18,8 +18,13 @@ require('promise/setimmediate/done'); /** * Handle either fulfillment or rejection with the same callback. */ -Promise.prototype.finally = function(onSettled) { - return this.then(onSettled, onSettled); -}; +Promise.prototype.finally = function(callback) { + return this.then( + value => Promise.resolve(callback()).then(() => value), + reason => Promise.resolve(callback()).then(() => { + throw reason; + }) + ); +} module.exports = Promise;