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