Skip to content

Commit

Permalink
LibJS/Bytecode: Transfer object expression property names to functions
Browse files Browse the repository at this point in the history
2 new passes on test262. :^)
  • Loading branch information
awesomekling committed Jun 25, 2023
1 parent ad15a1e commit f146a1b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Userland/Libraries/LibJS/Bytecode/ASTCodegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -874,8 +874,12 @@ Bytecode::CodeGenerationErrorOr<void> ObjectExpression::generate_bytecode(Byteco
auto& string_literal = static_cast<StringLiteral const&>(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<Bytecode::Op::PutById>(object_reg, key_name, property_kind);
} else {
Expand Down

0 comments on commit f146a1b

Please sign in to comment.