You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
345 B

  1. 'use strict';
  2. var Promise = require('./core.js');
  3. module.exports = Promise;
  4. Promise.prototype.finally = function (f) {
  5. return this.then(function (value) {
  6. return Promise.resolve(f()).then(function () {
  7. return value;
  8. });
  9. }, function (err) {
  10. return Promise.resolve(f()).then(function () {
  11. throw err;
  12. });
  13. });
  14. };