1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 01:07:35 +00:00

LibJS: Add the remaining generator objects

- %GeneratorFunction%
- %GeneratorFunction.prototype%
- %GeneratorFunction.prototype.prototype%
- %Generator%.prototype
This commit is contained in:
Matthew Olsson 2021-06-15 00:04:08 -07:00 committed by Linus Groh
parent b205c9814a
commit 22b17219ff
14 changed files with 302 additions and 67 deletions

View file

@ -0,0 +1,26 @@
/*
* Copyright (c) 2021, Matthew Olsson <mattco@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibJS/Runtime/NativeFunction.h>
namespace JS {
// 27.3.1 %GeneratorFunction%, https://tc39.es/ecma262/#sec-generatorfunction-constructor
class GeneratorFunctionConstructor final : public NativeFunction {
JS_OBJECT(GeneratorFunctionConstructor, NativeFunction);
public:
explicit GeneratorFunctionConstructor(GlobalObject&);
virtual void initialize(GlobalObject&) override;
virtual ~GeneratorFunctionConstructor() override;
virtual Value call() override;
virtual Value construct(Function& new_target) override;
};
}