
This is a continuation of the previous commit. Calling initialize() is the first thing that's done after allocating a cell on the JS heap - and in the common case of allocating an object, that's where properties are assigned and intrinsics occasionally accessed. Since those are supposed to live on the realm eventually, this is another step into that direction.
27 lines
544 B
C++
27 lines
544 B
C++
/*
|
|
* Copyright (c) 2021, Linus Groh <linusg@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibJS/Runtime/GlobalObject.h>
|
|
#include <LibJS/Runtime/Object.h>
|
|
|
|
namespace JS::Test262 {
|
|
|
|
class AgentObject final : public Object {
|
|
JS_OBJECT(AgentObject, Object);
|
|
|
|
public:
|
|
explicit AgentObject(Realm&);
|
|
virtual void initialize(JS::Realm&) override;
|
|
virtual ~AgentObject() override = default;
|
|
|
|
private:
|
|
JS_DECLARE_NATIVE_FUNCTION(monotonic_now);
|
|
JS_DECLARE_NATIVE_FUNCTION(sleep);
|
|
};
|
|
|
|
}
|