LibJS/Bytecode: Support class field initializers

Fixes 513 test262 tests. :^)
This commit is contained in:
Andreas Kling 2023-06-17 10:11:23 +02:00
commit d89e0b36d4
Notes: sideshowbarker 2024-07-17 11:30:54 +09:00
3 changed files with 49 additions and 36 deletions

View file

@ -2593,4 +2593,13 @@ Bytecode::CodeGenerationErrorOr<void> MetaProperty::generate_bytecode(Bytecode::
VERIFY_NOT_REACHED();
}
Bytecode::CodeGenerationErrorOr<void> ClassFieldInitializerStatement::generate_bytecode(Bytecode::Generator& generator) const
{
TRY(m_expression->generate_bytecode(generator));
generator.perform_needed_unwinds<Bytecode::Op::Return>();
generator.emit<Bytecode::Op::Return>();
return {};
}
}