mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 17:15:09 +00:00
Shell: Convert all immediately convertible fallible functions to ErrorOr
This commit is contained in:
parent
e403dbabfa
commit
0c28fd41ed
7 changed files with 59 additions and 50 deletions
|
@ -465,7 +465,7 @@ ErrorOr<RefPtr<AST::Node>> Shell::immediate_value_or_default(AST::ImmediateExpre
|
|||
}
|
||||
|
||||
auto name = TRY(TRY(const_cast<AST::Node&>(arguments.first()).run(*this))->resolve_as_string(*this));
|
||||
if (!local_variable_or(name, ""sv).is_empty())
|
||||
if (!TRY(local_variable_or(name, ""sv)).is_empty())
|
||||
return make_ref_counted<AST::SimpleVariable>(invoking_node.position(), name);
|
||||
|
||||
return arguments.last();
|
||||
|
@ -479,7 +479,7 @@ ErrorOr<RefPtr<AST::Node>> Shell::immediate_assign_default(AST::ImmediateExpress
|
|||
}
|
||||
|
||||
auto name = TRY(TRY(const_cast<AST::Node&>(arguments.first()).run(*this))->resolve_as_string(*this));
|
||||
if (!local_variable_or(name, ""sv).is_empty())
|
||||
if (!TRY(local_variable_or(name, ""sv)).is_empty())
|
||||
return make_ref_counted<AST::SimpleVariable>(invoking_node.position(), name);
|
||||
|
||||
auto value = TRY(TRY(const_cast<AST::Node&>(arguments.last()).run(*this))->resolve_without_cast(*this));
|
||||
|
@ -496,7 +496,7 @@ ErrorOr<RefPtr<AST::Node>> Shell::immediate_error_if_empty(AST::ImmediateExpress
|
|||
}
|
||||
|
||||
auto name = TRY(TRY(const_cast<AST::Node&>(arguments.first()).run(*this))->resolve_as_string(*this));
|
||||
if (!local_variable_or(name, ""sv).is_empty())
|
||||
if (!TRY(local_variable_or(name, ""sv)).is_empty())
|
||||
return make_ref_counted<AST::SimpleVariable>(invoking_node.position(), name);
|
||||
|
||||
auto error_value = TRY(TRY(const_cast<AST::Node&>(arguments.last()).run(*this))->resolve_as_string(*this));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue