mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 21:29:06 +00:00
LibJS: Make Script and Module GC-allocated
This ensures that code currently in any active or saved execution stack always stays alive.
This commit is contained in:
parent
cb15132146
commit
00c8f07192
Notes:
sideshowbarker
2024-07-17 07:23:36 +09:00
Author: https://github.com/awesomekling
Commit: 00c8f07192
Pull-request: https://github.com/SerenityOS/serenity/pull/14816
Reviewed-by: https://github.com/ADKaster
Reviewed-by: https://github.com/linusg ✅
18 changed files with 145 additions and 89 deletions
|
@ -3262,10 +3262,10 @@ Completion MetaProperty::execute(Interpreter& interpreter) const
|
|||
auto script_or_module = interpreter.vm().get_active_script_or_module();
|
||||
|
||||
// 2. Assert: module is a Source Text Module Record.
|
||||
VERIFY(script_or_module.has<WeakPtr<Module>>());
|
||||
VERIFY(script_or_module.get<WeakPtr<Module>>());
|
||||
VERIFY(is<SourceTextModule>(*script_or_module.get<WeakPtr<Module>>()));
|
||||
auto& module = static_cast<SourceTextModule&>(*script_or_module.get<WeakPtr<Module>>());
|
||||
VERIFY(script_or_module.has<NonnullGCPtr<Module>>());
|
||||
VERIFY(script_or_module.get<NonnullGCPtr<Module>>());
|
||||
VERIFY(is<SourceTextModule>(*script_or_module.get<NonnullGCPtr<Module>>()));
|
||||
auto& module = static_cast<SourceTextModule&>(*script_or_module.get<NonnullGCPtr<Module>>());
|
||||
|
||||
// 3. Let importMeta be module.[[ImportMeta]].
|
||||
auto* import_meta = module.import_meta();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue