mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 09:07:44 +00:00
LibJS: Let Shape store a Realm instead of a GlobalObject
This is a cautious first step towards being able to create JS objects before a global object has been instantiated.
This commit is contained in:
parent
7a6935a2ff
commit
50d951aea2
22 changed files with 104 additions and 55 deletions
|
@ -50,8 +50,9 @@
|
|||
|
||||
namespace Web::Bindings {
|
||||
|
||||
WindowObject::WindowObject(HTML::Window& impl)
|
||||
: m_impl(impl)
|
||||
WindowObject::WindowObject(JS::Realm& realm, HTML::Window& impl)
|
||||
: GlobalObject(realm)
|
||||
, m_impl(impl)
|
||||
{
|
||||
impl.set_wrapper({}, *this);
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ class WindowObject
|
|||
JS_OBJECT(WindowObject, JS::GlobalObject);
|
||||
|
||||
public:
|
||||
explicit WindowObject(HTML::Window&);
|
||||
explicit WindowObject(JS::Realm&, HTML::Window&);
|
||||
virtual void initialize_global_object() override;
|
||||
virtual ~WindowObject() override = default;
|
||||
|
||||
|
|
|
@ -113,7 +113,7 @@ void Worker::run_a_worker(AK::URL& url, EnvironmentSettingsObject& outside_setti
|
|||
|
||||
// FIXME: Make and use subclasses of WorkerGlobalScope, however this requires JS::GlobalObject to
|
||||
// play nicely with the IDL interpreter, to make spec-compliant extensions, which it currently does not.
|
||||
m_worker_scope = m_worker_vm->heap().allocate_without_global_object<JS::GlobalObject>();
|
||||
m_worker_scope = m_worker_vm->heap().allocate_without_global_object<JS::GlobalObject>(*m_worker_realm);
|
||||
m_worker_scope->initialize_global_object();
|
||||
|
||||
m_console = adopt_ref(*new WorkerDebugConsoleClient(m_worker_scope->console()));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue