mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-27 11:48:32 +00:00
LibJS+LibTest+js: Convert BC::Interpreter::run to ThrowCompletionOr<>
Note that this is just a shallow API change.
This commit is contained in:
committed by
Linus Groh
parent
3b0bf05fa5
commit
070d2eaa51
@@ -146,6 +146,12 @@ Interpreter::ValueAndFrame Interpreter::run_and_return_frame(Executable const& e
|
||||
m_manually_entered_frames.take_last();
|
||||
}
|
||||
|
||||
Value exception_value;
|
||||
if (vm().exception()) {
|
||||
exception_value = vm().exception()->value();
|
||||
vm().clear_exception();
|
||||
}
|
||||
|
||||
auto return_value = m_return_value.value_or(js_undefined());
|
||||
m_return_value = {};
|
||||
|
||||
@@ -162,6 +168,9 @@ Interpreter::ValueAndFrame Interpreter::run_and_return_frame(Executable const& e
|
||||
|
||||
vm().finish_execution_generation();
|
||||
|
||||
if (!exception_value.is_empty())
|
||||
return { throw_completion(exception_value), move(frame) };
|
||||
|
||||
return { return_value, move(frame) };
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user