2020-04-04 22:28:21 +02:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
|
|
|
|
*
|
2021-04-22 01:24:48 -07:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-04-04 22:28:21 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <LibJS/Runtime/NativeFunction.h>
|
|
|
|
|
|
|
|
namespace JS {
|
|
|
|
|
|
|
|
class ArrayConstructor final : public NativeFunction {
|
2020-06-21 15:14:02 +02:00
|
|
|
JS_OBJECT(ArrayConstructor, NativeFunction);
|
|
|
|
|
2020-04-04 22:28:21 +02:00
|
|
|
public:
|
2022-08-16 00:20:49 +01:00
|
|
|
explicit ArrayConstructor(Realm&);
|
2020-07-22 17:50:18 +02:00
|
|
|
virtual void initialize(GlobalObject&) override;
|
2022-03-14 10:25:06 -06:00
|
|
|
virtual ~ArrayConstructor() override = default;
|
2020-04-04 22:28:21 +02:00
|
|
|
|
2021-10-20 21:16:30 +01:00
|
|
|
virtual ThrowCompletionOr<Value> call() override;
|
|
|
|
virtual ThrowCompletionOr<Object*> construct(FunctionObject& new_target) override;
|
2020-04-04 22:28:21 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
virtual bool has_constructor() const override { return true; }
|
2020-05-08 16:28:35 +01:00
|
|
|
|
2021-10-23 01:51:56 +03:00
|
|
|
JS_DECLARE_NATIVE_FUNCTION(from);
|
|
|
|
JS_DECLARE_NATIVE_FUNCTION(is_array);
|
|
|
|
JS_DECLARE_NATIVE_FUNCTION(of);
|
2021-06-07 19:31:32 +03:00
|
|
|
|
2021-10-23 01:51:56 +03:00
|
|
|
JS_DECLARE_NATIVE_FUNCTION(symbol_species_getter);
|
2020-04-04 22:28:21 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|