Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix context suspend and resume in notifyAll

  • Loading branch information...
commit e648f7ce872921178e8da01e6ee3bfe31025dccf 1 parent 78c8c53
@dstarke dstarke authored
Showing with 10 additions and 4 deletions.
  1. +10 −4 lib/promise.js
View
14 lib/promise.js
@@ -152,7 +152,10 @@ function Deferred(canceller){
throw new Error("This deferred has already been resolved");
}
try{
- if(previousContext != context){
+ if(previousContext !== context){
+ if(previousContext && previousContext.suspend){
+ previousContext.suspend();
+ }
exports.currentContext = context;
if(context && context.resume){
context.resume();
@@ -165,11 +168,14 @@ function Deferred(canceller){
}
}
finally{
- if(previousContext != context){
- exports.currentContext = previousContext;
- if(context && context.suspend){
+ if(previousContext !== context){
+ if(context && context.suspend){
context.suspend();
}
+ if(previousContext && previousContext.resume){
+ previousContext.resume();
+ }
+ exports.currentContext = previousContext;
}
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.