1 | // should work in any browser without browserify
|
2 |
|
3 | if (typeof Promise.prototype.done !== 'function') {
|
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 | }
|
12 | } |
\ | No newline at end of file |