Skip to content

Commit

Permalink
XS: remove references to handlers when resolving promises
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Soquet committed Jun 25, 2021
1 parent 3349ac0 commit 22116a6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions xs/sources/xsPromise.c
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,7 @@ void fxRejectPromise(txMachine* the)
fxQueueJob(the, 1, promise);
slot = slot->next;
}
mxPromiseThens(promise)->value.reference->next = C_NULL;
}
else {
mxPushReference(promise);
Expand Down Expand Up @@ -706,6 +707,7 @@ void fxResolvePromise(txMachine* the)
fxQueueJob(the, 1, promise);
slot = slot->next;
}
mxPromiseThens(promise)->value.reference->next = C_NULL;
slot = mxPromiseStatus(promise);
slot->value.integer = mxFulfilledStatus;
}
Expand All @@ -725,6 +727,7 @@ void fxResolvePromise(txMachine* the)
fxQueueJob(the, 1, promise);
slot = slot->next;
}
mxPromiseThens(promise)->value.reference->next = C_NULL;
}
else {
mxPushReference(promise);
Expand Down

0 comments on commit 22116a6

Please sign in to comment.