| 
									
										
										
										
											2020-06-06 01:14:10 +01:00
										 |  |  | /*
 | 
					
						
							| 
									
										
										
										
											2022-12-13 20:49:50 +00:00
										 |  |  |  * Copyright (c) 2020-2022, Linus Groh <linusg@serenityos.org> | 
					
						
							| 
									
										
										
										
											2020-06-06 01:14:10 +01:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2021-04-22 01:24:48 -07:00
										 |  |  |  * SPDX-License-Identifier: BSD-2-Clause | 
					
						
							| 
									
										
										
										
											2020-06-06 01:14:10 +01:00
										 |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #pragma once
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <LibJS/Runtime/BigInt.h>
 | 
					
						
							|  |  |  | #include <LibJS/Runtime/Object.h>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | namespace JS { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-06-28 21:39:13 -07:00
										 |  |  | class JS_API BigIntObject final : public Object { | 
					
						
							| 
									
										
										
										
											2020-06-21 15:14:02 +02:00
										 |  |  |     JS_OBJECT(BigIntObject, Object); | 
					
						
							| 
									
										
										
										
											2024-11-15 04:01:23 +13:00
										 |  |  |     GC_DECLARE_ALLOCATOR(BigIntObject); | 
					
						
							| 
									
										
										
										
											2020-06-21 15:14:02 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-06 01:14:10 +01:00
										 |  |  | public: | 
					
						
							| 
									
										
										
										
											2024-11-15 04:01:23 +13:00
										 |  |  |     static GC::Ref<BigIntObject> create(Realm&, BigInt&); | 
					
						
							| 
									
										
										
										
											2020-06-06 01:14:10 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-03-14 10:25:06 -06:00
										 |  |  |     virtual ~BigIntObject() override = default; | 
					
						
							| 
									
										
										
										
											2020-06-06 01:14:10 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-18 19:44:46 +01:00
										 |  |  |     BigInt const& bigint() const { return m_bigint; } | 
					
						
							|  |  |  |     BigInt& bigint() { return m_bigint; } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-06 01:14:10 +01:00
										 |  |  | private: | 
					
						
							| 
									
										
										
										
											2022-08-28 23:51:28 +02:00
										 |  |  |     BigIntObject(BigInt&, Object& prototype); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-03-25 08:34:06 +00:00
										 |  |  |     virtual bool is_bigint_object() const final { return true; } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-28 14:33:36 +01:00
										 |  |  |     virtual void visit_edges(Visitor&) override; | 
					
						
							| 
									
										
										
										
											2020-06-06 01:14:10 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-11-15 04:01:23 +13:00
										 |  |  |     GC::Ref<BigInt> m_bigint; | 
					
						
							| 
									
										
										
										
											2020-06-06 01:14:10 +01:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-03-25 08:34:06 +00:00
										 |  |  | template<> | 
					
						
							|  |  |  | inline bool Object::fast_is<BigIntObject>() const { return is_bigint_object(); } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-06 01:14:10 +01:00
										 |  |  | } |