| 
									
										
										
										
											2020-04-04 14:34:31 +01:00
										 |  |  | /*
 | 
					
						
							| 
									
										
										
										
											2021-04-22 22:51:19 +02:00
										 |  |  |  * Copyright (c) 2020, Linus Groh <linusg@serenityos.org> | 
					
						
							| 
									
										
										
										
											2020-04-04 14:34:31 +01:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2021-04-22 01:24:48 -07:00
										 |  |  |  * SPDX-License-Identifier: BSD-2-Clause | 
					
						
							| 
									
										
										
										
											2020-04-04 14:34:31 +01:00
										 |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #pragma once
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <LibJS/Runtime/NativeFunction.h>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | namespace JS { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class FunctionConstructor final : public NativeFunction { | 
					
						
							| 
									
										
										
										
											2020-06-21 15:14:02 +02:00
										 |  |  |     JS_OBJECT(FunctionConstructor, NativeFunction); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-04-04 14:34:31 +01:00
										 |  |  | public: | 
					
						
							| 
									
										
										
										
											2021-06-27 21:48:34 +02:00
										 |  |  |     static RefPtr<FunctionExpression> create_dynamic_function_node(GlobalObject& global_object, FunctionObject& new_target, FunctionKind kind); | 
					
						
							| 
									
										
										
										
											2021-06-16 10:52:48 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-20 15:40:48 +02:00
										 |  |  |     explicit FunctionConstructor(GlobalObject&); | 
					
						
							| 
									
										
										
										
											2020-07-22 17:50:18 +02:00
										 |  |  |     virtual void initialize(GlobalObject&) override; | 
					
						
							| 
									
										
										
										
											2020-04-04 14:34:31 +01:00
										 |  |  |     virtual ~FunctionConstructor() override; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-09-27 17:24:14 +02:00
										 |  |  |     virtual Value call() override; | 
					
						
							| 
									
										
										
										
											2021-06-27 21:48:34 +02:00
										 |  |  |     virtual Value construct(FunctionObject& new_target) override; | 
					
						
							| 
									
										
										
										
											2020-04-04 14:34:31 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | private: | 
					
						
							|  |  |  |     virtual bool has_constructor() const override { return true; } | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | } |