2021-06-28 13:26:01 +02:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2021-09-29 17:53:57 +01:00
|
|
|
#include <LibJS/Runtime/Completion.h>
|
2021-06-28 21:19:25 +02:00
|
|
|
#include <LibJS/Runtime/Environment.h>
|
2021-06-28 13:26:01 +02:00
|
|
|
#include <LibJS/Runtime/Object.h>
|
|
|
|
|
|
|
|
namespace JS {
|
|
|
|
|
|
|
|
class ArgumentsObject final : public Object {
|
|
|
|
JS_OBJECT(ArgumentsObject, Object);
|
|
|
|
|
|
|
|
public:
|
2021-06-28 21:19:25 +02:00
|
|
|
ArgumentsObject(GlobalObject&, Environment&);
|
2021-06-28 13:26:01 +02:00
|
|
|
|
|
|
|
virtual void initialize(GlobalObject&) override;
|
|
|
|
virtual ~ArgumentsObject() override;
|
2021-06-28 21:19:25 +02:00
|
|
|
|
|
|
|
Environment& environment() { return m_environment; }
|
|
|
|
|
2021-09-29 17:53:57 +01:00
|
|
|
virtual ThrowCompletionOr<Optional<PropertyDescriptor>> internal_get_own_property(PropertyName const&) const override;
|
2021-09-29 17:54:25 +01:00
|
|
|
virtual ThrowCompletionOr<bool> internal_define_own_property(PropertyName const&, PropertyDescriptor const&) override;
|
2021-09-29 18:20:10 +01:00
|
|
|
virtual ThrowCompletionOr<Value> internal_get(PropertyName const&, Value receiver) const override;
|
2021-09-29 18:31:37 +01:00
|
|
|
virtual ThrowCompletionOr<bool> internal_set(PropertyName const&, Value value, Value receiver) override;
|
2021-09-29 18:45:33 +01:00
|
|
|
virtual ThrowCompletionOr<bool> internal_delete(PropertyName const&) override;
|
2021-06-28 21:19:25 +02:00
|
|
|
|
|
|
|
// [[ParameterMap]]
|
|
|
|
Object& parameter_map() { return *m_parameter_map; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
virtual void visit_edges(Cell::Visitor&) override;
|
|
|
|
|
|
|
|
Environment& m_environment;
|
|
|
|
Object* m_parameter_map { nullptr };
|
2021-06-28 13:26:01 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|