BigInt.cpp 548 B

12345678910111213141516171819202122232425262728
  1. /*
  2. * Copyright (c) 2020, Linus Groh <linusg@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <LibCrypto/BigInt/SignedBigInteger.h>
  7. #include <LibJS/Heap/Heap.h>
  8. #include <LibJS/Runtime/BigInt.h>
  9. namespace JS {
  10. BigInt::BigInt(Crypto::SignedBigInteger big_integer)
  11. : m_big_integer(move(big_integer))
  12. {
  13. VERIFY(!m_big_integer.is_invalid());
  14. }
  15. BigInt::~BigInt()
  16. {
  17. }
  18. BigInt* js_bigint(Heap& heap, Crypto::SignedBigInteger big_integer)
  19. {
  20. return heap.allocate_without_global_object<BigInt>(move(big_integer));
  21. }
  22. }