mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
LibJS/Bytecode: Transfer object expression property names to functions
2 new passes on test262. :^)
This commit is contained in:
Notes:
sideshowbarker
2024-07-17 10:31:19 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/a4a1d1b84a Pull-request: https://github.com/SerenityOS/serenity/pull/19637
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user