mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 08:38:10 +00:00
LibJS: Add GraphLoadingState Record
This patch adds the GraphLoadingState Record with a struct HostDefined for use in the HostDefined field.
This commit is contained in:
parent
dd90ed11b3
commit
c3b02ae65a
1 changed files with 18 additions and 1 deletions
|
@ -22,7 +22,24 @@ enum class ModuleStatus {
|
|||
Evaluated
|
||||
};
|
||||
|
||||
// 16.2.1.5 Cyclic Module Records, https://tc39.es/ecma262/#sec-cyclic-module-records
|
||||
class CyclicModule;
|
||||
|
||||
// https://tc39.es/ecma262/#graphloadingstate-record
|
||||
struct GraphLoadingState {
|
||||
struct HostDefined {
|
||||
virtual ~HostDefined() = default;
|
||||
|
||||
virtual void visit_edges(Cell::Visitor&) { }
|
||||
};
|
||||
|
||||
GCPtr<PromiseCapability> promise_capability; // [[PromiseCapability]]
|
||||
bool is_loading { false }; // [[IsLoading]]
|
||||
size_t pending_module_count { 0 }; // [[PendingModulesCount]]
|
||||
HashTable<CyclicModule*> visited; // [[Visited]]
|
||||
Optional<HostDefined> host_defined; // [[HostDefined]]
|
||||
};
|
||||
|
||||
// 16.2.1.5 Cyclic Module Records, https://tc39.es/ecma262/#cyclic-module-record
|
||||
class CyclicModule : public Module {
|
||||
JS_CELL(CyclicModule, Module);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue