1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-29 20:15:11 +00:00
serenity/Userland/Libraries/LibJS/Contrib/Test262/GlobalObject.h
Andreas Kling 50d951aea2 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.
2022-08-05 12:42:46 +02:00

35 lines
719 B
C++

/*
* Copyright (c) 2021, Linus Groh <linusg@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibJS/Contrib/Test262/$262Object.h>
#include <LibJS/Runtime/GlobalObject.h>
namespace JS::Test262 {
class GlobalObject final : public JS::GlobalObject {
JS_OBJECT(GlobalObject, JS::GlobalObject);
public:
GlobalObject(JS::Realm& realm)
: JS::GlobalObject(realm)
{
}
virtual void initialize_global_object() override;
virtual ~GlobalObject() override = default;
$262Object* $262() const { return m_$262; }
private:
virtual void visit_edges(Visitor&) override;
$262Object* m_$262 { nullptr };
JS_DECLARE_NATIVE_FUNCTION(print);
};
}