Skip to content

Commit 6d0f3aa

Browse files
Merge pull request #111 from oven-sh/revive-async-context
Revive fork changes for async context
2 parents a04a318 + 1ad8153 commit 6d0f3aa

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Source/JavaScriptCore/builtins/PromiseOperations.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@
3030
function 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

Comments
 (0)