mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 09:45:06 +02:00
LibJS+LibWeb: Add C++ compile_parsed_module wrapper
Add compile_parsed_module() to RustIntegration, which takes a RustParsedProgram and a SourceCode (from parse_program with ProgramType::Module) and compiles it on the main thread with GC interaction. Rewrite compile_module() to use the new split functions internally. Add SourceTextModule::parse_from_pre_parsed() and JavaScriptModuleScript::create_from_pre_parsed() to allow creating module scripts from a pre-parsed RustParsedProgram. This prepares the infrastructure for off-thread module parsing.
This commit is contained in:
committed by
Andreas Kling
parent
7d45e897c4
commit
3f4d3d6108
Notes:
github-actions[bot]
2026-03-06 12:07:29 +00:00
Author: https://github.com/awesomekling Commit: https://github.com/LadybirdBrowser/ladybird/commit/3f4d3d61080 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8211 Reviewed-by: https://github.com/ADKaster Reviewed-by: https://github.com/Zaggy1024 Reviewed-by: https://github.com/alimpfard
@@ -10,6 +10,8 @@
|
||||
#include <LibWeb/Export.h>
|
||||
#include <LibWeb/HTML/Scripting/Script.h>
|
||||
|
||||
struct RustParsedProgram;
|
||||
|
||||
namespace Web::HTML {
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/webappapis.html#module-script
|
||||
@@ -34,6 +36,7 @@ public:
|
||||
virtual ~JavaScriptModuleScript() override;
|
||||
|
||||
static WebIDL::ExceptionOr<GC::Ptr<JavaScriptModuleScript>> create(ByteString const& filename, StringView source, JS::Realm&, URL::URL base_url);
|
||||
static WebIDL::ExceptionOr<GC::Ptr<JavaScriptModuleScript>> create_from_pre_parsed(ByteString const& filename, StringView source, JS::Realm&, URL::URL base_url, RustParsedProgram* parsed);
|
||||
|
||||
enum class PreventErrorReporting {
|
||||
Yes,
|
||||
|
||||
Reference in New Issue
Block a user