ladybird/Libraries/LibJS/Runtime/NumberConstructor.h

36 lines
893 B
C
Raw Permalink Normal View History

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