| 
									
										
										
										
											2020-04-04 23:13:13 +02:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  * Copyright (c) 2020, Andreas Kling <kling@serenityos.org> | 
					
						
							|  |  |  |  * | 
					
						
							| 
									
										
										
										
											2021-04-22 01:24:48 -07:00
										 |  |  |  * SPDX-License-Identifier: BSD-2-Clause | 
					
						
							| 
									
										
										
										
											2020-04-04 23:13:13 +02:00
										 |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-04-17 18:55:53 +02:00
										 |  |  | #include <LibJS/Runtime/GlobalObject.h>
 | 
					
						
							| 
									
										
										
										
											2020-04-04 23:13:13 +02:00
										 |  |  | #include <LibJS/Runtime/NumberObject.h>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | namespace JS { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-11-19 09:45:05 +01:00
										 |  |  | JS_DEFINE_ALLOCATOR(NumberObject); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-12-13 20:49:50 +00:00
										 |  |  | NonnullGCPtr<NumberObject> NumberObject::create(Realm& realm, double value) | 
					
						
							| 
									
										
										
										
											2020-04-17 18:55:53 +02:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2023-08-13 13:05:26 +02:00
										 |  |  |     return realm.heap().allocate<NumberObject>(realm, value, realm.intrinsics().number_prototype()); | 
					
						
							| 
									
										
										
										
											2020-04-17 18:55:53 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | NumberObject::NumberObject(double value, Object& prototype) | 
					
						
							| 
									
										
										
										
											2022-12-14 12:17:58 +01:00
										 |  |  |     : Object(ConstructWithPrototypeTag::Tag, prototype) | 
					
						
							| 
									
										
										
										
											2020-04-18 10:27:57 +02:00
										 |  |  |     , m_value(value) | 
					
						
							| 
									
										
										
										
											2020-04-04 23:13:13 +02:00
										 |  |  | { | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2022-04-17 22:59:52 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-04-04 23:13:13 +02:00
										 |  |  | } |