/* * Copyright (c) 2021, Andreas Kling * * SPDX-License-Identifier: BSD-2-Clause */ #include #include namespace Web::Bindings { JS::VM& main_thread_vm() { static RefPtr vm; if (!vm) { vm = JS::VM::create(make()); static_cast(vm->custom_data())->event_loop.set_vm(*vm); } return *vm; } }