2020-04-04 17:28:21 -03:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
|
|
|
|
|
*
|
2021-04-22 05:24:48 -03:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-04-04 17:28:21 -03:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <LibJS/Runtime/NativeFunction.h>
|
|
|
|
|
|
|
|
|
|
namespace JS {
|
|
|
|
|
|
|
|
|
|
class ArrayConstructor final : public NativeFunction {
|
2020-06-21 10:14:02 -03:00
|
|
|
JS_OBJECT(ArrayConstructor, NativeFunction);
|
|
|
|
|
|
2020-04-04 17:28:21 -03:00
|
|
|
public:
|
2020-06-20 10:40:48 -03:00
|
|
|
explicit ArrayConstructor(GlobalObject&);
|
2020-07-22 12:50:18 -03:00
|
|
|
virtual void initialize(GlobalObject&) override;
|
2020-04-04 17:28:21 -03:00
|
|
|
virtual ~ArrayConstructor() override;
|
|
|
|
|
|
2020-09-27 12:24:14 -03:00
|
|
|
virtual Value call() override;
|
2021-06-27 16:48:34 -03:00
|
|
|
virtual Value construct(FunctionObject& new_target) override;
|
2020-04-04 17:28:21 -03:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
virtual bool has_constructor() const override { return true; }
|
2020-05-08 12:28:35 -03:00
|
|
|
|
2020-08-17 10:52:24 -03:00
|
|
|
JS_DECLARE_NATIVE_FUNCTION(from);
|
2020-06-20 08:55:34 -03:00
|
|
|
JS_DECLARE_NATIVE_FUNCTION(is_array);
|
|
|
|
|
JS_DECLARE_NATIVE_FUNCTION(of);
|
2021-06-07 13:31:32 -03:00
|
|
|
|
|
|
|
|
JS_DECLARE_NATIVE_GETTER(symbol_species_getter);
|
2020-04-04 17:28:21 -03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|