LibJS: Add the Set built-in object

This commit is contained in:
Idan Horowitz 2021-06-09 00:08:47 +03:00 committed by Linus Groh
commit 670be04c81
Notes: sideshowbarker 2024-07-18 12:34:18 +09:00
15 changed files with 359 additions and 30 deletions

View file

@ -0,0 +1,30 @@
/*
* 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 SetConstructor final : public NativeFunction {
JS_OBJECT(SetConstructor, NativeFunction);
public:
explicit SetConstructor(GlobalObject&);
virtual void initialize(GlobalObject&) override;
virtual ~SetConstructor() override;
virtual Value call() override;
virtual Value construct(Function&) override;
private:
virtual bool has_constructor() const override { return true; }
JS_DECLARE_NATIVE_GETTER(symbol_species_getter);
};
}