mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-14 21:11:57 +00:00
LibJS: Make Op::Return value required
It turns out we do not have any scenario where this is not provided.
This commit is contained in:
parent
17364c6d36
commit
20dba8f1ab
Notes:
github-actions[bot]
2025-05-23 01:27:06 +00:00
Author: https://github.com/shannonbooth
Commit: 20dba8f1ab
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4760
3 changed files with 8 additions and 13 deletions
|
@ -2925,10 +2925,7 @@ void NewFunction::execute_impl(Bytecode::Interpreter& interpreter) const
|
|||
|
||||
void Return::execute_impl(Bytecode::Interpreter& interpreter) const
|
||||
{
|
||||
if (m_value.has_value())
|
||||
interpreter.do_return(interpreter.get(*m_value));
|
||||
else
|
||||
interpreter.do_return(js_undefined());
|
||||
interpreter.do_return(interpreter.get(m_value));
|
||||
}
|
||||
|
||||
ThrowCompletionOr<void> Increment::execute_impl(Bytecode::Interpreter& interpreter) const
|
||||
|
@ -3781,9 +3778,7 @@ ByteString NewClass::to_byte_string_impl(Bytecode::Executable const& executable)
|
|||
|
||||
ByteString Return::to_byte_string_impl(Bytecode::Executable const& executable) const
|
||||
{
|
||||
if (m_value.has_value())
|
||||
return ByteString::formatted("Return {}", format_operand("value"sv, m_value.value(), executable));
|
||||
return "Return";
|
||||
return ByteString::formatted("Return {}", format_operand("value"sv, m_value, executable));
|
||||
}
|
||||
|
||||
ByteString Increment::to_byte_string_impl(Bytecode::Executable const& executable) const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue