diff options
author | Idan Horowitz <idan.horowitz@gmail.com> | 2021-11-02 18:49:08 +0200 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-11-02 19:48:35 +0100 |
commit | 390a04a985104b6468c1d34b57b95fcd16cc2957 (patch) | |
tree | c39b52c5aa60b8d3fd9b544a998160b20638adb3 /Tests | |
parent | d73b2588749aa6e03dbc829602a10d752a127ad2 (diff) | |
download | serenity-390a04a985104b6468c1d34b57b95fcd16cc2957.zip |
LibJS: Convert the GetValue AO to ThrowCompletionOr
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/LibJS/test-js.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/Tests/LibJS/test-js.cpp b/Tests/LibJS/test-js.cpp index c2246f7574..5f94af77f4 100644 --- a/Tests/LibJS/test-js.cpp +++ b/Tests/LibJS/test-js.cpp @@ -65,9 +65,7 @@ TESTJS_GLOBAL_FUNCTION(mark_as_garbage, markAsGarbage) auto reference = vm.resolve_binding(variable_name.string(), outer_environment.value()->lexical_environment); - auto value = reference.get_value(global_object); - if (auto* exception = vm.exception()) - return JS::throw_completion(exception->value()); + auto value = TRY(reference.get_value(global_object)); if (!value.is_object()) return vm.throw_completion<JS::TypeError>(global_object, JS::ErrorType::NotAnObject, String::formatted("Variable with name {}", variable_name.string())); |