aboutsummaryrefslogtreecommitdiff
path: root/node_modules/promise/lib/done.js
diff options
context:
space:
mode:
authornanalelfe <nargiza.nosirova@mail.utoronto.ca>2016-07-25 05:40:57 +0000
committernanalelfe <nargiza.nosirova@mail.utoronto.ca>2016-07-25 05:40:57 +0000
commit5ae1a4bc73f34d3a8f83607b79fe20d4594238e6 (patch)
tree824776472687456292f71a98b96ff6fb2de85a5c /node_modules/promise/lib/done.js
parent3ca0e78b313a1bded021cbb8b2dad241d7cad049 (diff)
Populated profile page with comments
Diffstat (limited to 'node_modules/promise/lib/done.js')
-rw-r--r--node_modules/promise/lib/done.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/node_modules/promise/lib/done.js b/node_modules/promise/lib/done.js
new file mode 100644
index 0000000..f879317
--- /dev/null
+++ b/node_modules/promise/lib/done.js
@@ -0,0 +1,13 @@
+'use strict';
+
+var Promise = require('./core.js');
+
+module.exports = Promise;
+Promise.prototype.done = function (onFulfilled, onRejected) {
+ var self = arguments.length ? this.then.apply(this, arguments) : this;
+ self.then(null, function (err) {
+ setTimeout(function () {
+ throw err;
+ }, 0);
+ });
+};