1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 17:45:09 +00:00

LibJS: Convert resolve_this_binding() to ThrowCompletionOr

Also add spec comments.
This commit is contained in:
davidot 2021-12-30 23:00:37 +01:00 committed by Linus Groh
parent dc03529ffd
commit a24df37713
4 changed files with 13 additions and 5 deletions

View file

@ -315,7 +315,13 @@ void Jump::execute_impl(Bytecode::Interpreter& interpreter) const
void ResolveThisBinding::execute_impl(Bytecode::Interpreter& interpreter) const
{
interpreter.accumulator() = interpreter.vm().resolve_this_binding(interpreter.global_object());
auto this_binding_or_error = interpreter.vm().resolve_this_binding(interpreter.global_object());
if (this_binding_or_error.is_throw_completion()) {
interpreter.vm().throw_exception(interpreter.global_object(), this_binding_or_error.release_error().value());
return;
}
interpreter.accumulator() = this_binding_or_error.release_value();
}
void Jump::replace_references_impl(BasicBlock const& from, BasicBlock const& to)