mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 03:47:35 +00:00
LibJS: Add host layering point related to modules to VM
Also make HostResolveImportedModule fail on the browser to prevent module loading for now.
This commit is contained in:
parent
0b89dbc529
commit
be9d478d92
3 changed files with 14 additions and 0 deletions
|
@ -170,6 +170,7 @@ class Script;
|
|||
class Shape;
|
||||
class Statement;
|
||||
class StringOrSymbol;
|
||||
class SourceTextModule;
|
||||
class Symbol;
|
||||
class Token;
|
||||
class Utf16String;
|
||||
|
@ -180,6 +181,7 @@ class WrappedFunction;
|
|||
enum class DeclarationKind;
|
||||
struct AlreadyResolved;
|
||||
struct JobCallback;
|
||||
struct ModuleRequest;
|
||||
struct PromiseCapability;
|
||||
|
||||
// Not included in JS_ENUMERATE_NATIVE_OBJECTS due to missing distinct prototype
|
||||
|
|
|
@ -241,6 +241,13 @@ public:
|
|||
|
||||
ScriptOrModule get_active_script_or_module() const;
|
||||
|
||||
Function<ThrowCompletionOr<NonnullRefPtr<Module>>(ScriptOrModule, ModuleRequest const&)> host_resolve_imported_module;
|
||||
Function<void(ScriptOrModule, ModuleRequest const&, PromiseCapability)> host_import_module_dynamically;
|
||||
Function<void(ScriptOrModule, ModuleRequest const&, PromiseCapability, Promise*)> host_finish_dynamic_import;
|
||||
|
||||
Function<HashMap<PropertyKey, Value>(SourceTextModule const&)> host_get_import_meta_properties;
|
||||
Function<void(Object*, SourceTextModule const&)> host_finalize_import_meta;
|
||||
|
||||
private:
|
||||
explicit VM(OwnPtr<CustomData>);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue