1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 15:48:12 +00:00

LibJS/Bytecode: Add codegen for "named evaluation if anonymous function"

This gives anonymous functions the name from the LHS they are being
assigned to.

171 new passes on test262. :^)
This commit is contained in:
Andreas Kling 2023-06-23 14:27:42 +02:00
parent a92d94f4e9
commit 85a3a1c085
8 changed files with 109 additions and 27 deletions

View file

@ -85,7 +85,9 @@ public:
void push_home_object(Register);
void pop_home_object();
void emit_new_function(JS::FunctionNode const&);
void emit_new_function(JS::FunctionExpression const&, Optional<DeprecatedFlyString const&> lhs_name);
CodeGenerationErrorOr<void> emit_named_evaluation_if_anonymous_function(Expression const&, Optional<DeprecatedFlyString const&> lhs_name);
void begin_continuable_scope(Label continue_target, Vector<DeprecatedFlyString> const& language_label_set);
void end_continuable_scope();