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.

13 lines
314 B

  1. 'use strict';
  2. var Promise = require('./core.js');
  3. module.exports = Promise;
  4. Promise.prototype.done = function (onFulfilled, onRejected) {
  5. var self = arguments.length ? this.then.apply(this, arguments) : this;
  6. self.then(null, function (err) {
  7. setTimeout(function () {
  8. throw err;
  9. }, 0);
  10. });
  11. };