summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Contrib/Test262/GlobalObject.h
blob: 168467d0b6cae384aa945891bc891049a3184398 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
 * Copyright (c) 2021-2022, 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(Realm&) 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);
};

}