Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

done.js 314 B

3 lat temu
12345678910111213
  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. };