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

LibJS: Implement the NewClass opcode

This commit is contained in:
Ali Mohammad Pur 2022-02-11 22:38:21 +03:30 committed by Linus Groh
parent 8b27917603
commit d7c207beb9
4 changed files with 23 additions and 4 deletions

View file

@ -536,10 +536,14 @@ ThrowCompletionOr<void> IteratorResultValue::execute_impl(Bytecode::Interpreter&
return {};
}
ThrowCompletionOr<void> NewClass::execute_impl(Bytecode::Interpreter&) const
ThrowCompletionOr<void> NewClass::execute_impl(Bytecode::Interpreter& interpreter) const
{
(void)m_class_expression;
TODO();
auto name = m_class_expression.name();
auto scope = interpreter.ast_interpreter_scope();
auto& ast_interpreter = scope.interpreter();
auto class_object = TRY(m_class_expression.class_definition_evaluation(ast_interpreter, interpreter.global_object(), name, name.is_null() ? "" : name));
interpreter.accumulator() = class_object;
return {};
}
String Load::to_string_impl(Bytecode::Executable const&) const