1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-16 20:05:07 +00:00

LibJS/Bytecode: Add support for new.target

This commit is contained in:
Luke Wilde 2022-03-19 19:40:21 +00:00 committed by Andreas Kling
parent fd235d8a06
commit eac5534ce4
5 changed files with 46 additions and 0 deletions

View file

@ -358,6 +358,12 @@ ThrowCompletionOr<void> ResolveThisBinding::execute_impl(Bytecode::Interpreter&
return {};
}
ThrowCompletionOr<void> GetNewTarget::execute_impl(Bytecode::Interpreter& interpreter) const
{
interpreter.accumulator() = interpreter.vm().get_new_target();
return {};
}
void Jump::replace_references_impl(BasicBlock const& from, BasicBlock const& to)
{
if (m_true_target.has_value() && &m_true_target->block() == &from)
@ -976,4 +982,9 @@ String ResolveThisBinding::to_string_impl(Bytecode::Executable const&) const
return "ResolveThisBinding"sv;
}
String GetNewTarget::to_string_impl(Bytecode::Executable const&) const
{
return "GetNewTarget"sv;
}
}