mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-09 09:34:57 +09:00
Everywhere: Hoist the Libraries folder to the top-level
This commit is contained in:
parent
950e819ee7
commit
93712b24bf
Notes:
github-actions[bot]
2024-11-10 11:51:52 +00:00
Author: https://github.com/trflynn89
Commit: 93712b24bf
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2256
Reviewed-by: https://github.com/sideshowbarker
4547 changed files with 104 additions and 113 deletions
40
Libraries/LibJS/Runtime/BigInt.h
Normal file
40
Libraries/LibJS/Runtime/BigInt.h
Normal file
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* Copyright (c) 2020-2022, Linus Groh <linusg@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/Error.h>
|
||||
#include <AK/String.h>
|
||||
#include <AK/StringView.h>
|
||||
#include <LibCrypto/BigInt/SignedBigInteger.h>
|
||||
#include <LibJS/Heap/Cell.h>
|
||||
#include <LibJS/Heap/CellAllocator.h>
|
||||
|
||||
namespace JS {
|
||||
|
||||
class BigInt final : public Cell {
|
||||
JS_CELL(BigInt, Cell);
|
||||
JS_DECLARE_ALLOCATOR(BigInt);
|
||||
|
||||
public:
|
||||
[[nodiscard]] static NonnullGCPtr<BigInt> create(VM&, Crypto::SignedBigInteger);
|
||||
|
||||
virtual ~BigInt() override = default;
|
||||
|
||||
Crypto::SignedBigInteger const& big_integer() const { return m_big_integer; }
|
||||
|
||||
ErrorOr<String> to_string() const;
|
||||
ByteString to_byte_string() const { return ByteString::formatted("{}n", m_big_integer.to_base_deprecated(10)); }
|
||||
|
||||
private:
|
||||
explicit BigInt(Crypto::SignedBigInteger);
|
||||
|
||||
Crypto::SignedBigInteger m_big_integer;
|
||||
};
|
||||
|
||||
ThrowCompletionOr<BigInt*> number_to_bigint(VM&, Value);
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue