| 
									
										
										
										
											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: | 
					
						
							| 
									
										
										
										
											2023-08-07 08:41:28 +02:00
										 |  |  |     virtual void initialize(Realm&) override; | 
					
						
							| 
									
										
										
										
											2022-03-14 10:25:06 -06:00
										 |  |  |     virtual ~ArgumentsObject() override = default; | 
					
						
							| 
									
										
										
										
											2021-06-28 21:19:25 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     Environment& environment() { return m_environment; } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-24 16:01:24 +02:00
										 |  |  |     virtual ThrowCompletionOr<Optional<PropertyDescriptor>> internal_get_own_property(PropertyKey const&) const override; | 
					
						
							|  |  |  |     virtual ThrowCompletionOr<bool> internal_define_own_property(PropertyKey const&, PropertyDescriptor const&) override; | 
					
						
							| 
									
										
										
										
											2023-07-08 17:39:18 +02:00
										 |  |  |     virtual ThrowCompletionOr<Value> internal_get(PropertyKey const&, Value receiver, CacheablePropertyMetadata*) const override; | 
					
						
							| 
									
										
										
										
											2021-10-24 16:01:24 +02:00
										 |  |  |     virtual ThrowCompletionOr<bool> internal_set(PropertyKey const&, Value value, Value receiver) override; | 
					
						
							|  |  |  |     virtual ThrowCompletionOr<bool> internal_delete(PropertyKey const&) override; | 
					
						
							| 
									
										
										
										
											2021-06-28 21:19:25 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-10-05 08:58:30 +02:00
										 |  |  |     virtual bool may_interfere_with_indexed_property_access() const final { return true; } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-06-28 21:19:25 +02:00
										 |  |  |     // [[ParameterMap]]
 | 
					
						
							|  |  |  |     Object& parameter_map() { return *m_parameter_map; } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | private: | 
					
						
							| 
									
										
										
										
											2022-08-28 23:51:28 +02:00
										 |  |  |     ArgumentsObject(Realm&, Environment&); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-06-28 21:19:25 +02:00
										 |  |  |     virtual void visit_edges(Cell::Visitor&) override; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-02-26 16:09:02 -07:00
										 |  |  |     NonnullGCPtr<Environment> m_environment; | 
					
						
							|  |  |  |     GCPtr<Object> m_parameter_map; | 
					
						
							| 
									
										
										
										
											2021-06-28 13:26:01 +02:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | } |