LibJS: Add Interpreter::create<GlobalObjectType>()

Force Interpreter construction to go via a create() helper that takes
the global object type as a template parameter.
This commit is contained in:
Andreas Kling 2020-04-01 21:04:51 +02:00
commit 9d5d0261e1
Notes: sideshowbarker 2024-07-19 08:00:41 +09:00
3 changed files with 16 additions and 17 deletions

View file

@ -360,10 +360,8 @@ Color Document::visited_link_color() const
JS::Interpreter& Document::interpreter()
{
if (!m_interpreter) {
m_interpreter = make<JS::Interpreter>();
m_interpreter->initialize_global_object<Bindings::WindowObject>(*m_window);
}
if (!m_interpreter)
m_interpreter = JS::Interpreter::create<Bindings::WindowObject>(*m_window);
return *m_interpreter;
}