mirror of https://github.com/nodejs/node.git
13 lines
279 B
JavaScript
13 lines
279 B
JavaScript
|
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();
|