LibJS: Localize popping of execution context in AsyncFunctionDriver

Instead of adding a flag for the two callers that need a pop of the
execution context stack when invoking continue_async_execution inline
the pop of the execution context.

This makes the management of these stacks and surrounding VERIFY calls
much more obvious.
This commit is contained in:
Shannon Booth 2025-01-22 18:59:37 +13:00 committed by Andrew Kaster
commit b58ba2e1bd
Notes: github-actions[bot] 2025-01-30 20:58:24 +00:00
2 changed files with 6 additions and 15 deletions

View file

@ -19,17 +19,12 @@ class AsyncFunctionDriverWrapper final : public Promise {
GC_DECLARE_ALLOCATOR(AsyncFunctionDriverWrapper);
public:
enum class IsInitialExecution {
No,
Yes,
};
[[nodiscard]] static GC::Ref<Promise> create(Realm&, GeneratorObject*);
virtual ~AsyncFunctionDriverWrapper() override = default;
void visit_edges(Cell::Visitor&) override;
void continue_async_execution(VM&, Value, bool is_successful, IsInitialExecution is_initial_execution = IsInitialExecution::No);
void continue_async_execution(VM&, Value, bool is_successful);
private:
AsyncFunctionDriverWrapper(Realm&, GC::Ref<GeneratorObject>, GC::Ref<Promise> top_level_promise);