mirror of https://github.com/lukechilds/node.git
Ryan Dahl
15 years ago
5 changed files with 9 additions and 66 deletions
@ -1,27 +0,0 @@ |
|||
node.mixin(require("common.js")); |
|||
|
|||
var cancelFired = false; |
|||
|
|||
var promise = new node.Promise(); |
|||
promise.addCallback(function() { |
|||
assertUnreachable('addCallback should not fire after promise.cancel()'); |
|||
}); |
|||
|
|||
promise.addErrback(function() { |
|||
assertUnreachable('addErrback should not fire after promise.cancel()'); |
|||
}); |
|||
|
|||
promise.addCancelback(function() { |
|||
cancelFired = true; |
|||
}); |
|||
|
|||
promise.cancel(); |
|||
|
|||
setTimeout(function() { |
|||
promise.emitSuccess(); |
|||
promise.emitError(); |
|||
}, 100); |
|||
|
|||
process.addListener('exit', function() { |
|||
assertTrue(cancelFired); |
|||
}); |
Loading…
Reference in new issue