mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 12:49:19 +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
|
@ -54,7 +54,7 @@ ThrowCompletionOr<Value> Interpreter::run(Script& script_record)
|
|||
script_context.realm = &script_record.realm();
|
||||
|
||||
// 5. Set the ScriptOrModule of scriptContext to scriptRecord.
|
||||
script_context.script_or_module = script_record.make_weak_ptr();
|
||||
script_context.script_or_module = NonnullGCPtr<Script>(script_record);
|
||||
|
||||
// 6. Set the VariableEnvironment of scriptContext to globalEnv.
|
||||
script_context.variable_environment = &global_environment;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue