| 
									
										
										
										
											2020-03-30 00:21:56 +01:00
										 |  |  | /*
 | 
					
						
							| 
									
										
										
										
											2021-04-22 22:51:19 +02:00
										 |  |  |  * Copyright (c) 2020, Linus Groh <linusg@serenityos.org> | 
					
						
							| 
									
										
										
										
											2020-03-30 00:21:56 +01:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2021-04-22 01:24:48 -07:00
										 |  |  |  * SPDX-License-Identifier: BSD-2-Clause | 
					
						
							| 
									
										
										
										
											2020-03-30 00:21:56 +01:00
										 |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #pragma once
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <LibJS/Runtime/NativeFunction.h>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | namespace JS { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class DateConstructor final : public NativeFunction { | 
					
						
							| 
									
										
										
										
											2020-06-21 15:14:02 +02:00
										 |  |  |     JS_OBJECT(DateConstructor, NativeFunction); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-03-30 00:21:56 +01:00
										 |  |  | public: | 
					
						
							| 
									
										
										
										
											2022-08-16 00:20:49 +01:00
										 |  |  |     explicit DateConstructor(Realm&); | 
					
						
							| 
									
										
										
										
											2020-07-22 17:50:18 +02:00
										 |  |  |     virtual void initialize(GlobalObject&) override; | 
					
						
							| 
									
										
										
										
											2022-03-14 10:25:06 -06:00
										 |  |  |     virtual ~DateConstructor() override = default; | 
					
						
							| 
									
										
										
										
											2020-03-30 00:21:56 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-20 21:16:30 +01:00
										 |  |  |     virtual ThrowCompletionOr<Value> call() override; | 
					
						
							|  |  |  |     virtual ThrowCompletionOr<Object*> construct(FunctionObject& new_target) override; | 
					
						
							| 
									
										
										
										
											2020-03-30 00:21:56 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | private: | 
					
						
							| 
									
										
										
										
											2020-04-01 18:31:24 +01:00
										 |  |  |     virtual bool has_constructor() const override { return true; } | 
					
						
							| 
									
										
										
										
											2020-03-30 00:21:56 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-23 03:28:01 +03:00
										 |  |  |     JS_DECLARE_NATIVE_FUNCTION(now); | 
					
						
							|  |  |  |     JS_DECLARE_NATIVE_FUNCTION(parse); | 
					
						
							|  |  |  |     JS_DECLARE_NATIVE_FUNCTION(utc); | 
					
						
							| 
									
										
										
										
											2020-03-30 00:21:56 +01:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | } |