| 
									
										
										
										
											2021-06-28 13:26:01 +02:00
										 |  |  | /*
 | 
					
						
							| 
									
										
										
										
											2025-05-11 12:32:24 +02:00
										 |  |  |  * Copyright (c) 2021-2025, Andreas Kling <andreas@ladybird.org> | 
					
						
							| 
									
										
										
										
											2021-06-28 13:26:01 +02:00
										 |  |  |  * | 
					
						
							|  |  |  |  * 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 { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-06-28 21:39:13 -07:00
										 |  |  | class JS_API ArgumentsObject final : public Object { | 
					
						
							| 
									
										
										
										
											2021-06-28 13:26:01 +02:00
										 |  |  |     JS_OBJECT(ArgumentsObject, Object); | 
					
						
							| 
									
										
										
										
											2024-11-15 04:01:23 +13:00
										 |  |  |     GC_DECLARE_ALLOCATOR(ArgumentsObject); | 
					
						
							| 
									
										
										
										
											2021-06-28 13:26:01 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 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
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-24 16:01:24 +02:00
										 |  |  |     virtual ThrowCompletionOr<Optional<PropertyDescriptor>> internal_get_own_property(PropertyKey const&) const override; | 
					
						
							| 
									
										
										
										
											2024-11-01 21:03:18 +01:00
										 |  |  |     virtual ThrowCompletionOr<bool> internal_define_own_property(PropertyKey const&, PropertyDescriptor const&, Optional<PropertyDescriptor>* precomputed_get_own_property = nullptr) override; | 
					
						
							| 
									
										
										
										
											2024-05-02 11:13:08 +02:00
										 |  |  |     virtual ThrowCompletionOr<Value> internal_get(PropertyKey const&, Value receiver, CacheablePropertyMetadata*, PropertyLookupPhase) const override; | 
					
						
							| 
									
										
										
										
											2025-05-04 16:00:13 +02:00
										 |  |  |     virtual ThrowCompletionOr<bool> internal_set(PropertyKey const&, Value value, Value receiver, CacheablePropertyMetadata*, PropertyLookupPhase) override; | 
					
						
							| 
									
										
										
										
											2021-10-24 16:01:24 +02:00
										 |  |  |     virtual ThrowCompletionOr<bool> internal_delete(PropertyKey const&) override; | 
					
						
							| 
									
										
										
										
											2021-06-28 21:19:25 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-05-11 12:32:24 +02:00
										 |  |  |     void set_mapped_names(Vector<FlyString> mapped_names) { m_mapped_names = move(mapped_names); } | 
					
						
							| 
									
										
										
										
											2021-06-28 21:19:25 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | private: | 
					
						
							| 
									
										
										
										
											2022-08-28 23:51:28 +02:00
										 |  |  |     ArgumentsObject(Realm&, Environment&); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-05-11 12:32:24 +02:00
										 |  |  |     [[nodiscard]] bool parameter_map_has(PropertyKey const&) const; | 
					
						
							|  |  |  |     [[nodiscard]] Value get_from_parameter_map(PropertyKey const&) const; | 
					
						
							|  |  |  |     void set_in_parameter_map(PropertyKey const&, Value); | 
					
						
							|  |  |  |     void delete_from_parameter_map(PropertyKey const&); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-06-28 21:19:25 +02:00
										 |  |  |     virtual void visit_edges(Cell::Visitor&) override; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-11-15 04:01:23 +13:00
										 |  |  |     GC::Ref<Environment> m_environment; | 
					
						
							| 
									
										
										
										
											2025-05-11 12:32:24 +02:00
										 |  |  |     Vector<FlyString> m_mapped_names; | 
					
						
							| 
									
										
										
										
											2021-06-28 13:26:01 +02:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | } |