| 
									
										
										
										
											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; | 
					
						
							| 
									
										
										
										
											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; | 
					
						
							|  |  |  |     virtual ThrowCompletionOr<Value> internal_get(PropertyKey const&, Value receiver) const override; | 
					
						
							|  |  |  |     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
										 |  |  | 
 | 
					
						
							|  |  |  |     // [[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
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | } |