ladybird/Userland/Libraries/LibJS/Runtime/AsyncGeneratorRequest.h
Linus Groh fc9d587e39 LibJS: Make PromiseCapability GC-allocated
A struct with three raw pointers to other GC'd types is a pretty big
liability, let's just turn this into a Cell itself.
This comes with the additional benefit of being able to capture it in
a lambda effortlessly, without having to create handles for individual
members.
2022-10-02 23:02:27 +01:00

20 lines
495 B
C++

/*
* Copyright (c) 2022, Linus Groh <linusg@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibJS/Runtime/Completion.h>
#include <LibJS/Runtime/PromiseCapability.h>
namespace JS {
// 27.6.3.1 AsyncGeneratorRequest Records, https://tc39.es/ecma262/#sec-asyncgeneratorrequest-records
struct AsyncGeneratorRequest {
Completion completion; // [[Completion]]
NonnullGCPtr<PromiseCapability> capability; // [[Capability]]
};
}