[SignalingServer] Optimize dependent modules
[platform/framework/web/wrtjs.git] / device_home / node_modules / express / node_modules / promise / polyfill-done.js
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 }