| 
									
										
										
										
											2021-06-09 00:08:47 +03:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  * Copyright (c) 2021, Idan Horowitz <idan.horowitz@serenityos.org> | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * SPDX-License-Identifier: BSD-2-Clause | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #pragma once
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <LibJS/Runtime/NativeFunction.h>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | namespace JS { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-07-19 10:41:08 -07:00
										 |  |  | class SetConstructor final : public NativeFunction { | 
					
						
							| 
									
										
										
										
											2021-06-09 00:08:47 +03:00
										 |  |  |     JS_OBJECT(SetConstructor, NativeFunction); | 
					
						
							| 
									
										
										
										
											2024-11-15 04:01:23 +13:00
										 |  |  |     GC_DECLARE_ALLOCATOR(SetConstructor); | 
					
						
							| 
									
										
										
										
											2021-06-09 00:08:47 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | public: | 
					
						
							| 
									
										
										
										
											2023-08-07 08:41:28 +02:00
										 |  |  |     virtual void initialize(Realm&) override; | 
					
						
							| 
									
										
										
										
											2022-03-14 10:25:06 -06:00
										 |  |  |     virtual ~SetConstructor() override = default; | 
					
						
							| 
									
										
										
										
											2021-06-09 00:08:47 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-20 21:16:30 +01:00
										 |  |  |     virtual ThrowCompletionOr<Value> call() override; | 
					
						
							| 
									
										
										
										
											2024-11-15 04:01:23 +13:00
										 |  |  |     virtual ThrowCompletionOr<GC::Ref<Object>> construct(FunctionObject&) override; | 
					
						
							| 
									
										
										
										
											2021-06-09 00:08:47 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | private: | 
					
						
							| 
									
										
										
										
											2022-08-28 23:51:28 +02:00
										 |  |  |     explicit SetConstructor(Realm&); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-06-09 00:08:47 +03:00
										 |  |  |     virtual bool has_constructor() const override { return true; } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-29 00:18:17 +03:00
										 |  |  |     JS_DECLARE_NATIVE_FUNCTION(symbol_species_getter); | 
					
						
							| 
									
										
										
										
											2021-06-09 00:08:47 +03:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | } |