You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// NOTE: This is not done, because we're not suspending anything (see above).
55
56
56
57
// d. Resume the suspended evaluation of asyncContext using NormalCompletion(value) as the result of the operation that suspended it.
57
58
// e. Assert: When we reach this step, asyncContext has already been removed from the execution context stack and prevContext is the currently running execution context.
@@ -65,7 +66,7 @@ ThrowCompletionOr<Value> await(GlobalObject& global_object, Value value)
65
66
auto on_fulfilled = NativeFunction::create(global_object, "", move(fulfilled_closure));
66
67
67
68
// 5. Let rejectedClosure be a new Abstract Closure with parameters (reason) that captures asyncContext and performs the following steps when called:
// NOTE: This is not done, because we're not suspending anything (see above).
79
80
80
81
// d. Resume the suspended evaluation of asyncContext using ThrowCompletion(reason) as the result of the operation that suspended it.
81
82
// e. Assert: When we reach this step, asyncContext has already been removed from the execution context stack and prevContext is the currently running execution context.
@@ -89,21 +90,32 @@ ThrowCompletionOr<Value> await(GlobalObject& global_object, Value value)
89
90
auto on_rejected = NativeFunction::create(global_object, "", move(rejected_closure));
// 8. Remove asyncContext from the execution context stack and restore the execution context that is at the top of the execution context stack as the running execution context.
95
-
vm.pop_execution_context();
104
+
// NOTE: Since we don't push any EC, this step is not performed.
96
105
97
106
// 9. Set the code evaluation state of asyncContext such that when evaluation is resumed with a Completion completion, the following steps of the algorithm that invoked Await will be performed, with completion available.
98
107
// 10. Return.
99
108
// 11. NOTE: This returns to the evaluation of the operation that had most previously resumed evaluation of asyncContext.
100
-
// FIXME: Since we don't support context suspension, we synchronously execute the promise
109
+
101
110
vm.run_queued_promise_jobs();
102
111
103
-
if (success)
112
+
// Make sure that the promise _actually_ resolved.
113
+
// Note that this is checked down the chain (result.is_empty()) anyway, but let's make the source of the issue more clear.
0 commit comments