3030function pushNewPromiseReaction ( thenable , existingReactions , promiseOrCapability , onFulfilled , onRejected , context )
3131{
3232 "use strict" ;
33-
33+ var asyncContext = @ getInternalField ( @ asyncContext , 0 ) ;
3434 if ( ! existingReactions ) {
3535 existingReactions = {
3636 @promiseOrCapability : promiseOrCapability ,
3737 @onFulfilled : onFulfilled ,
3838 @onRejected : onRejected ,
39- @context : context ,
39+ @context : asyncContext ? [ context , asyncContext ] : context ,
4040 // This is 4x the number of out of line reactions (promise, fulfill callback, reject callback, context).
4141 @outOfLineReactionCounts : 0 ,
4242 } ;
@@ -46,7 +46,7 @@ function pushNewPromiseReaction(thenable, existingReactions, promiseOrCapability
4646 @putByValDirect ( existingReactions , outOfLineReactionCounts ++ , promiseOrCapability ) ;
4747 @putByValDirect ( existingReactions , outOfLineReactionCounts ++ , onFulfilled ) ;
4848 @putByValDirect ( existingReactions , outOfLineReactionCounts ++ , onRejected ) ;
49- @putByValDirect ( existingReactions , outOfLineReactionCounts ++ , context ) ;
49+ @putByValDirect ( existingReactions , outOfLineReactionCounts ++ , asyncContext ? [ context , asyncContext ] : context ) ;
5050 existingReactions . @outOfLineReactionCounts = outOfLineReactionCounts ;
5151 }
5252}
0 commit comments