aboutsummaryrefslogtreecommitdiff
path: root/node_modules/promise/polyfill-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/polyfill-done.js
parent3ca0e78b313a1bded021cbb8b2dad241d7cad049 (diff)
Populated profile page with comments
Diffstat (limited to 'node_modules/promise/polyfill-done.js')
-rw-r--r--node_modules/promise/polyfill-done.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/node_modules/promise/polyfill-done.js b/node_modules/promise/polyfill-done.js
new file mode 100644
index 0000000..e50b4c0
--- /dev/null
+++ b/node_modules/promise/polyfill-done.js
@@ -0,0 +1,12 @@
+// should work in any browser without browserify
+
+if (typeof Promise.prototype.done !== 'function') {
+ 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)
+ })
+ }
+} \ No newline at end of file