mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:07:44 +00:00
LibJS: Add the Set built-in object
This commit is contained in:
parent
b17a282b4b
commit
670be04c81
15 changed files with 359 additions and 30 deletions
30
Userland/Libraries/LibJS/Runtime/SetConstructor.h
Normal file
30
Userland/Libraries/LibJS/Runtime/SetConstructor.h
Normal 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);
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue