2021-06-28 11:26:01 +00:00
|
|
|
/*
|
2024-10-04 11:19:50 +00:00
|
|
|
* Copyright (c) 2021, Andreas Kling <andreas@ladybird.org>
|
2021-06-28 11:26:01 +00:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2021-09-29 16:53:57 +00:00
|
|
|
#include <LibJS/Runtime/Completion.h>
|
2021-06-28 19:19:25 +00:00
|
|
|
#include <LibJS/Runtime/Environment.h>
|
2021-06-28 11:26:01 +00:00
|
|
|
#include <LibJS/Runtime/Object.h>
|
|
|
|
|
|
|
|
namespace JS {
|
|
|
|
|
|
|
|
class ArgumentsObject final : public Object {
|
|
|
|
JS_OBJECT(ArgumentsObject, Object);
|
2024-11-14 15:01:23 +00:00
|
|
|
GC_DECLARE_ALLOCATOR(ArgumentsObject);
|
2021-06-28 11:26:01 +00:00
|
|
|
|
|
|
|
public:
|
2023-08-07 06:41:28 +00:00
|
|
|
virtual void initialize(Realm&) override;
|
2022-03-14 16:25:06 +00:00
|
|
|
virtual ~ArgumentsObject() override = default;
|
2021-06-28 19:19:25 +00:00
|
|
|
|
|
|
|
Environment& environment() { return m_environment; }
|
|
|
|
|
2021-10-24 14:01:24 +00:00
|
|
|
virtual ThrowCompletionOr<Optional<PropertyDescriptor>> internal_get_own_property(PropertyKey const&) const override;
|
2024-11-01 20:03:18 +00:00
|
|
|
virtual ThrowCompletionOr<bool> internal_define_own_property(PropertyKey const&, PropertyDescriptor const&, Optional<PropertyDescriptor>* precomputed_get_own_property = nullptr) override;
|
2024-05-02 09:13:08 +00:00
|
|
|
virtual ThrowCompletionOr<Value> internal_get(PropertyKey const&, Value receiver, CacheablePropertyMetadata*, PropertyLookupPhase) const override;
|
2023-11-08 19:51:26 +00:00
|
|
|
virtual ThrowCompletionOr<bool> internal_set(PropertyKey const&, Value value, Value receiver, CacheablePropertyMetadata*) override;
|
2021-10-24 14:01:24 +00:00
|
|
|
virtual ThrowCompletionOr<bool> internal_delete(PropertyKey const&) override;
|
2021-06-28 19:19:25 +00:00
|
|
|
|
|
|
|
// [[ParameterMap]]
|
|
|
|
Object& parameter_map() { return *m_parameter_map; }
|
|
|
|
|
|
|
|
private:
|
2022-08-28 21:51:28 +00:00
|
|
|
ArgumentsObject(Realm&, Environment&);
|
|
|
|
|
2021-06-28 19:19:25 +00:00
|
|
|
virtual void visit_edges(Cell::Visitor&) override;
|
|
|
|
|
2024-11-14 15:01:23 +00:00
|
|
|
GC::Ref<Environment> m_environment;
|
|
|
|
GC::Ptr<Object> m_parameter_map;
|
2021-06-28 11:26:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|