ladybird/Libraries/LibJS/Runtime/BigIntConstructor.h

34 lines
802 B
C
Raw Normal View History

2020-06-06 01:14:10 +01:00
/*
* Copyright (c) 2020, Linus Groh <linusg@serenityos.org>
2020-06-06 01:14:10 +01:00
*
* SPDX-License-Identifier: BSD-2-Clause
2020-06-06 01:14:10 +01:00
*/
#pragma once
#include <LibJS/Runtime/NativeFunction.h>
namespace JS {
class BigIntConstructor final : public NativeFunction {
JS_OBJECT(BigIntConstructor, NativeFunction);
GC_DECLARE_ALLOCATOR(BigIntConstructor);
2020-06-06 01:14:10 +01:00
public:
virtual void initialize(Realm&) override;
virtual ~BigIntConstructor() override = default;
2020-06-06 01:14:10 +01:00
virtual ThrowCompletionOr<Value> call() override;
virtual ThrowCompletionOr<GC::Ref<Object>> construct(FunctionObject& new_target) override;
2020-06-06 01:14:10 +01:00
private:
explicit BigIntConstructor(Realm&);
2020-06-06 01:14:10 +01:00
virtual bool has_constructor() const override { return true; }
JS_DECLARE_NATIVE_FUNCTION(as_int_n);
JS_DECLARE_NATIVE_FUNCTION(as_uint_n);
2020-06-06 01:14:10 +01:00
};
}