mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 00:50:22 +00:00
js: Remove uses of TRY_OR_DISCARD()
Slightly more verbose, but that's the last user of TRY_OR_DISCARD gone!
This commit is contained in:
parent
c4f0f1cc05
commit
9e50bd91a6
Notes:
sideshowbarker
2024-07-17 21:38:25 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/9e50bd91a6d Pull-request: https://github.com/SerenityOS/serenity/pull/11626 Reviewed-by: https://github.com/IdanHo ✅
1 changed files with 8 additions and 5 deletions
|
@ -1426,12 +1426,15 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
|
||||
switch (mode) {
|
||||
case CompleteProperty: {
|
||||
Optional<JS::Value> maybe_value;
|
||||
auto maybe_variable = TRY_OR_DISCARD(vm->resolve_binding(variable_name, &global_environment));
|
||||
maybe_value = TRY_OR_DISCARD(maybe_variable.get_value(interpreter->global_object()));
|
||||
VERIFY(!maybe_value->is_empty());
|
||||
auto reference_or_error = vm->resolve_binding(variable_name, &global_environment);
|
||||
if (reference_or_error.is_error())
|
||||
return {};
|
||||
auto value_or_error = reference_or_error.value().get_value(interpreter->global_object());
|
||||
if (value_or_error.is_error())
|
||||
return {};
|
||||
auto variable = value_or_error.value();
|
||||
VERIFY(!variable.is_empty());
|
||||
|
||||
auto variable = *maybe_value;
|
||||
if (!variable.is_object())
|
||||
break;
|
||||
|
||||
|
|
Loading…
Reference in a new issue