You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
324 B
JavaScript
14 lines
324 B
JavaScript
6 years ago
|
'use strict';
|
||
|
|
||
|
var Promise = require('./core.js')
|
||
|
var asap = require('asap')
|
||
|
|
||
|
module.exports = Promise
|
||
|
Promise.prototype.done = function (onFulfilled, onRejected) {
|
||
|
var self = arguments.length ? this.then.apply(this, arguments) : this
|
||
|
self.then(null, function (err) {
|
||
|
asap(function () {
|
||
|
throw err
|
||
|
})
|
||
|
})
|
||
|
}
|