mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 20:59:16 +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
|
@ -2176,7 +2176,7 @@ class Return final : public Instruction {
|
|||
public:
|
||||
constexpr static bool IsTerminator = true;
|
||||
|
||||
explicit Return(Optional<Operand> value = {})
|
||||
explicit Return(Operand value)
|
||||
: Instruction(Type::Return)
|
||||
, m_value(value)
|
||||
{
|
||||
|
@ -2186,14 +2186,13 @@ public:
|
|||
ByteString to_byte_string_impl(Bytecode::Executable const&) const;
|
||||
void visit_operands_impl(Function<void(Operand&)> visitor)
|
||||
{
|
||||
if (m_value.has_value())
|
||||
visitor(m_value.value());
|
||||
visitor(m_value);
|
||||
}
|
||||
|
||||
Optional<Operand> const& value() const { return m_value; }
|
||||
Operand const& value() const { return m_value; }
|
||||
|
||||
private:
|
||||
Optional<Operand> m_value;
|
||||
Operand m_value;
|
||||
};
|
||||
|
||||
class Increment final : public Instruction {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue