| 
									
										
										
										
											2021-06-12 17:38:34 +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 { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class WeakRefConstructor final : public NativeFunction { | 
					
						
							|  |  |  |     JS_OBJECT(WeakRefConstructor, NativeFunction); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | public: | 
					
						
							|  |  |  |     explicit WeakRefConstructor(GlobalObject&); | 
					
						
							|  |  |  |     virtual void initialize(GlobalObject&) override; | 
					
						
							|  |  |  |     virtual ~WeakRefConstructor() override; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     virtual Value call() override; | 
					
						
							| 
									
										
										
										
											2021-06-27 21:48:34 +02:00
										 |  |  |     virtual Value construct(FunctionObject&) override; | 
					
						
							| 
									
										
										
										
											2021-06-12 17:38:34 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | private: | 
					
						
							|  |  |  |     virtual bool has_constructor() const override { return true; } | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | } |