-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
Labels
Description
-
What version of bluebird is the issue happening on? 3.4.1
-
What platform and version? (For example Node.js 0.12 or Google Chrome 32) Node.js 6.3.1
-
Did this issue happen with earlier version of bluebird? Yes
Description
Based on the examples in the docs, one would expect isCancelled() to be false after cancellation but this does not seem to be the case.
Example
const Promise = require('bluebird');
Promise.config({
cancellation: true
});
setTimeout(() => {
cancellablePromise.cancel();
console.log('1. isCancelled = ' + cancellablePromise.isCancelled());
}, 100);
const cancellablePromise = Promise.delay(300)
.finally(() => {
console.log('2. isCancelled = ' + cancellablePromise.isCancelled());
});
console.log('isCancellable = ' + cancellablePromise.isCancellable());
cancellablePromise
.finally(() => {
console.log('3. isCancelled = ' + cancellablePromise.isCancelled());
});Output
isCancellable = true
1. isCancelled = false
2. isCancelled = false
3. isCancelled = true
Is this the intended behavior or are the docs wrong?
Reactions are currently unavailable