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.

11 lines
350 B

  1. // should work in any browser without browserify
  2. if (typeof Promise.prototype.done !== 'function') {
  3. Promise.prototype.done = function (onFulfilled, onRejected) {
  4. var self = arguments.length ? this.then.apply(this, arguments) : this
  5. self.then(null, function (err) {
  6. setTimeout(function () {
  7. throw err
  8. }, 0)
  9. })
  10. }
  11. }