mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:17:35 +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:
parent
3b0bf05fa5
commit
070d2eaa51
7 changed files with 19 additions and 11 deletions
|
@ -102,10 +102,7 @@ ThrowCompletionOr<Value> GeneratorObject::next_impl(VM& vm, GlobalObject& global
|
|||
bytecode_interpreter->accumulator() = next_argument.value_or(js_undefined());
|
||||
}
|
||||
|
||||
// Temporarily switch to the captured execution context
|
||||
vm.push_execution_context(m_execution_context, global_object);
|
||||
|
||||
m_previous_value = bytecode_interpreter->run(*m_generating_function->bytecode_executable(), next_block);
|
||||
auto next_result = bytecode_interpreter->run(*m_generating_function->bytecode_executable(), next_block);
|
||||
|
||||
m_frame = move(*bytecode_interpreter->pop_frame());
|
||||
|
||||
|
@ -113,6 +110,8 @@ ThrowCompletionOr<Value> GeneratorObject::next_impl(VM& vm, GlobalObject& global
|
|||
|
||||
m_done = TRY(generated_continuation(m_previous_value)) == nullptr;
|
||||
|
||||
m_previous_value = TRY(next_result);
|
||||
|
||||
result->define_direct_property("value", TRY(generated_value(m_previous_value)), JS::default_attributes);
|
||||
result->define_direct_property("done", Value(m_done), JS::default_attributes);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue