/* * Copyright (c) 2020-2022, Linus Groh * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include #include #include #include #include namespace JS { class JS_API BigInt final : public Cell { GC_CELL(BigInt, Cell); GC_DECLARE_ALLOCATOR(BigInt); public: [[nodiscard]] static GC::Ref create(VM&, Crypto::SignedBigInteger); virtual ~BigInt() override = default; Crypto::SignedBigInteger const& big_integer() const { return m_big_integer; } ErrorOr to_string() const; Utf16String to_utf16_string() const; private: explicit BigInt(Crypto::SignedBigInteger); Crypto::SignedBigInteger m_big_integer; }; ThrowCompletionOr> number_to_bigint(VM&, Value); }