mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-31 05:39:55 +00:00
LibJS: Make JS::Script keep the VM alive
Script has a Handle member (m_realm), and for handles to remain valid, the VM must stay alive.
This commit is contained in:
@@ -30,7 +30,8 @@ NonnullRefPtr<Script> Script::parse(StringView source_text, Realm& realm, String
|
||||
}
|
||||
|
||||
Script::Script(Realm& realm, NonnullRefPtr<Program> parse_node)
|
||||
: m_realm(make_handle(&realm))
|
||||
: m_vm(realm.vm())
|
||||
, m_realm(make_handle(&realm))
|
||||
, m_parse_node(move(parse_node))
|
||||
{
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user