mirror of https://github.com/lukechilds/node.git
Friedemann Altrock
15 years ago
committed by
Ryan Dahl
2 changed files with 15 additions and 0 deletions
@ -0,0 +1,12 @@ |
|||||
|
process.mixin(require('./common')); |
||||
|
|
||||
|
var promise = new process.Promise(); |
||||
|
var cancelled = false; |
||||
|
promise.addCancelback(function(){ |
||||
|
if(cancelled){ |
||||
|
assertUnreachable("promise should not cancel more than once"); |
||||
|
} |
||||
|
cancelled = true; |
||||
|
}); |
||||
|
promise.cancel(); |
||||
|
promise.cancel(); |
Loading…
Reference in new issue