mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-10 01:59:31 +00:00
LibJS: Implement InnerModuleLoading as a free function
It is currently implemented as a member of CyclicModule. However, as the spec indicates, this must be invokable with non-CyclicModule modules. In several of the call sites, we are blindly casting to a CyclicModule; this will fail for e.g. JSON modules.
This commit is contained in:
parent
049109452e
commit
2c3077d929
Notes:
github-actions[bot]
2025-01-21 13:59:41 +00:00
Author: https://github.com/trflynn89
Commit: 2c3077d929
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3324
2 changed files with 20 additions and 15 deletions
|
@ -36,7 +36,9 @@ public:
|
|||
virtual ThrowCompletionOr<Promise*> evaluate(VM& vm) override final;
|
||||
|
||||
virtual PromiseCapability& load_requested_modules(GC::Ptr<GraphLoadingState::HostDefined>) override;
|
||||
virtual void inner_module_loading(GraphLoadingState& state);
|
||||
|
||||
ModuleStatus status() const { return m_status; }
|
||||
void set_status(ModuleStatus status) { m_status = status; }
|
||||
|
||||
Vector<ModuleRequest> const& requested_modules() const { return m_requested_modules; }
|
||||
Vector<ModuleWithSpecifier> const& loaded_modules() const { return m_loaded_modules; }
|
||||
|
@ -74,6 +76,7 @@ protected:
|
|||
Optional<u32> m_pending_async_dependencies; // [[PendingAsyncDependencies]]
|
||||
};
|
||||
|
||||
void inner_module_loading(VM&, GraphLoadingState& state, GC::Ref<Module>);
|
||||
void continue_module_loading(GraphLoadingState&, ThrowCompletionOr<GC::Ref<Module>> const&);
|
||||
void continue_dynamic_import(GC::Ref<PromiseCapability>, ThrowCompletionOr<GC::Ref<Module>> const& module_completion);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue