mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 07:47:37 +00:00
LibJS: Add the remaining generator objects
- %GeneratorFunction% - %GeneratorFunction.prototype% - %GeneratorFunction.prototype.prototype% - %Generator%.prototype
This commit is contained in:
parent
b205c9814a
commit
22b17219ff
14 changed files with 302 additions and 67 deletions
|
@ -16,20 +16,15 @@ class GeneratorObject final : public Object {
|
|||
|
||||
public:
|
||||
static GeneratorObject* create(GlobalObject&, Value, ScriptFunction*, ScopeObject*, Bytecode::RegisterWindow);
|
||||
explicit GeneratorObject(GlobalObject&);
|
||||
GeneratorObject(GlobalObject&, Object& prototype);
|
||||
virtual void initialize(GlobalObject&) override;
|
||||
virtual ~GeneratorObject() override;
|
||||
void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
static GeneratorObject* typed_this(VM&, GlobalObject&);
|
||||
Value next_impl(VM&, GlobalObject&, Optional<Value> value_to_throw);
|
||||
void set_done() { m_done = true; }
|
||||
|
||||
private:
|
||||
JS_DECLARE_NATIVE_FUNCTION(next);
|
||||
JS_DECLARE_NATIVE_FUNCTION(return_);
|
||||
JS_DECLARE_NATIVE_FUNCTION(throw_);
|
||||
|
||||
Value next_impl(VM&, GlobalObject&, Optional<Value> value_to_throw);
|
||||
|
||||
ScopeObject* m_scope { nullptr };
|
||||
ScriptFunction* m_generating_function { nullptr };
|
||||
Value m_previous_value;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue