mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:28:11 +00:00
LibJS/Bytecode: Set "home object" of functions within object expression
We manage this by having a stack of home objects in Generator, and then adding an optional home object parameter to the NewFunction instruction.
This commit is contained in:
parent
a33af174b2
commit
c9bd324369
5 changed files with 45 additions and 4 deletions
|
@ -83,6 +83,10 @@ public:
|
|||
CodeGenerationErrorOr<void> emit_store_to_reference(JS::ASTNode const&);
|
||||
CodeGenerationErrorOr<void> emit_delete_reference(JS::ASTNode const&);
|
||||
|
||||
void push_home_object(Register);
|
||||
void pop_home_object();
|
||||
void emit_new_function(JS::FunctionNode const&);
|
||||
|
||||
void begin_continuable_scope(Label continue_target, Vector<DeprecatedFlyString> const& language_label_set);
|
||||
void end_continuable_scope();
|
||||
void begin_breakable_scope(Label breakable_target, Vector<DeprecatedFlyString> const& language_label_set);
|
||||
|
@ -237,6 +241,7 @@ private:
|
|||
Vector<LabelableScope> m_breakable_scopes;
|
||||
Vector<LexicalScope> m_variable_scopes;
|
||||
Vector<BlockBoundaryType> m_boundaries;
|
||||
Vector<Register> m_home_objects;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue