2020-06-05 21:14:10 -03:00
|
|
|
/*
|
2021-04-22 17:51:19 -03:00
|
|
|
* Copyright (c) 2020, Linus Groh <linusg@serenityos.org>
|
2020-06-05 21:14:10 -03:00
|
|
|
*
|
2021-04-22 05:24:48 -03:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-06-05 21:14:10 -03:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <LibCrypto/BigInt/SignedBigInteger.h>
|
2020-09-27 15:18:30 -03:00
|
|
|
#include <LibJS/Heap/Heap.h>
|
2020-06-05 21:14:10 -03:00
|
|
|
#include <LibJS/Runtime/BigInt.h>
|
|
|
|
|
|
|
|
|
|
namespace JS {
|
|
|
|
|
|
|
|
|
|
BigInt::BigInt(Crypto::SignedBigInteger big_integer)
|
|
|
|
|
: m_big_integer(move(big_integer))
|
|
|
|
|
{
|
2021-02-23 16:42:32 -03:00
|
|
|
VERIFY(!m_big_integer.is_invalid());
|
2020-06-05 21:14:10 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BigInt::~BigInt()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BigInt* js_bigint(Heap& heap, Crypto::SignedBigInteger big_integer)
|
|
|
|
|
{
|
2020-07-24 15:46:55 -03:00
|
|
|
return heap.allocate_without_global_object<BigInt>(move(big_integer));
|
2020-06-05 21:14:10 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|