Commit 814d101b authored by Tristan Cavelier's avatar Tristan Cavelier

promy join and choose cancels promises when cancel method exist

parent d15716c6
...@@ -642,7 +642,9 @@ ...@@ -642,7 +642,9 @@
function cancel() { function cancel() {
var j; var j;
for (j = 0; j < promises.length; j += 1) { for (j = 0; j < promises.length; j += 1) {
promises[j].cancel(); if (typeof promises[j].cancel === 'function') {
promises[j].cancel();
}
} }
} }
deferred = new Deferred(cancel); deferred = new Deferred(cancel);
...@@ -691,7 +693,9 @@ ...@@ -691,7 +693,9 @@
function cancel() { function cancel() {
var j; var j;
for (j = 0; j < promises.length; j += 1) { for (j = 0; j < promises.length; j += 1) {
promises[j].cancel(); if (typeof promises[j].cancel === 'function') {
promises[j].cancel();
}
} }
} }
deferred = new Deferred(cancel); deferred = new Deferred(cancel);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment