2021-06-12 20:54:40 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2021, Idan Horowitz <idan.horowitz@serenityos.org>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <LibJS/Runtime/NativeFunction.h>
|
|
|
|
|
|
|
|
namespace JS {
|
|
|
|
|
|
|
|
class MapConstructor final : public NativeFunction {
|
|
|
|
JS_OBJECT(MapConstructor, NativeFunction);
|
2024-11-14 15:01:23 +00:00
|
|
|
GC_DECLARE_ALLOCATOR(MapConstructor);
|
2021-06-12 20:54:40 +00:00
|
|
|
|
|
|
|
public:
|
2023-08-07 06:41:28 +00:00
|
|
|
virtual void initialize(Realm&) override;
|
2022-03-14 16:25:06 +00:00
|
|
|
virtual ~MapConstructor() override = default;
|
2021-06-12 20:54:40 +00:00
|
|
|
|
2021-10-20 20:16:30 +00:00
|
|
|
virtual ThrowCompletionOr<Value> call() override;
|
2024-11-14 15:01:23 +00:00
|
|
|
virtual ThrowCompletionOr<GC::Ref<Object>> construct(FunctionObject&) override;
|
2021-06-12 20:54:40 +00:00
|
|
|
|
|
|
|
private:
|
2022-08-28 21:51:28 +00:00
|
|
|
explicit MapConstructor(Realm&);
|
|
|
|
|
2021-06-12 20:54:40 +00:00
|
|
|
virtual bool has_constructor() const override { return true; }
|
|
|
|
|
2023-07-11 14:23:00 +00:00
|
|
|
JS_DECLARE_NATIVE_FUNCTION(group_by);
|
|
|
|
|
2021-10-28 22:00:36 +00:00
|
|
|
JS_DECLARE_NATIVE_FUNCTION(symbol_species_getter);
|
2021-06-12 20:54:40 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|