summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Contrib/Test262/$262Object.h
blob: 831d761090ae77e2259aae65e6661b32875625ab (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
36
37
/*
 * Copyright (c) 2021, Linus Groh <linusg@serenityos.org>
 *
 * SPDX-License-Identifier: BSD-2-Clause
 */

#pragma once

#include <LibJS/Contrib/Test262/AgentObject.h>
#include <LibJS/Contrib/Test262/IsHTMLDDA.h>
#include <LibJS/Runtime/GlobalObject.h>
#include <LibJS/Runtime/Object.h>

namespace JS::Test262 {

class $262Object final : public Object {
    JS_OBJECT($262Object, Object);

public:
    virtual ThrowCompletionOr<void> initialize(Realm&) override;
    virtual ~$262Object() override = default;

private:
    explicit $262Object(Realm&);

    virtual void visit_edges(Visitor&) override;

    AgentObject* m_agent { nullptr };
    IsHTMLDDA* m_is_htmldda { nullptr };

    JS_DECLARE_NATIVE_FUNCTION(clear_kept_objects);
    JS_DECLARE_NATIVE_FUNCTION(create_realm);
    JS_DECLARE_NATIVE_FUNCTION(detach_array_buffer);
    JS_DECLARE_NATIVE_FUNCTION(eval_script);
};

}