BigIntConstructor.h 752 B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. * Copyright (c) 2020, Linus Groh <linusg@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibJS/Runtime/NativeFunction.h>
  8. namespace JS {
  9. class BigIntConstructor final : public NativeFunction {
  10. JS_OBJECT(BigIntConstructor, NativeFunction);
  11. public:
  12. explicit BigIntConstructor(GlobalObject&);
  13. virtual void initialize(GlobalObject&) override;
  14. virtual ~BigIntConstructor() override;
  15. virtual ThrowCompletionOr<Value> call() override;
  16. virtual ThrowCompletionOr<Object*> construct(FunctionObject& new_target) override;
  17. private:
  18. virtual bool has_constructor() const override { return true; }
  19. JS_DECLARE_NATIVE_FUNCTION(as_int_n);
  20. JS_DECLARE_NATIVE_FUNCTION(as_uint_n);
  21. };
  22. }