diff --git a/Userland/Libraries/LibJS/Bytecode/ASTCodegen.cpp b/Userland/Libraries/LibJS/Bytecode/ASTCodegen.cpp index fc823e6614..ac24932537 100644 --- a/Userland/Libraries/LibJS/Bytecode/ASTCodegen.cpp +++ b/Userland/Libraries/LibJS/Bytecode/ASTCodegen.cpp @@ -874,8 +874,12 @@ Bytecode::CodeGenerationErrorOr ObjectExpression::generate_bytecode(Byteco auto& string_literal = static_cast(property->key()); Bytecode::IdentifierTableIndex key_name = generator.intern_identifier(string_literal.value()); - if (property_kind != Bytecode::Op::PropertyKind::Spread) + if (property_kind == Bytecode::Op::PropertyKind::ProtoSetter) { TRY(property->value().generate_bytecode(generator)); + } else if (property_kind != Bytecode::Op::PropertyKind::Spread) { + DeprecatedFlyString name = string_literal.value(); + TRY(generator.emit_named_evaluation_if_anonymous_function(property->value(), name)); + } generator.emit(object_reg, key_name, property_kind); } else {