summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Runtime/ArrayConstructor.cpp
diff options
context:
space:
mode:
authorIdan Horowitz <idan.horowitz@gmail.com>2021-09-23 21:24:51 +0300
committerIdan Horowitz <idan.horowitz@gmail.com>2021-09-23 23:59:13 +0300
commitee825d6d9e1cb4d106a2fc87d9dafe517915d4de (patch)
treee956cef00a9bd7d42774bfa5098f3832fdd4086e /Userland/Libraries/LibJS/Runtime/ArrayConstructor.cpp
parentab594e5f2f60af7301d4a9e138d113389b25d40d (diff)
downloadserenity-ee825d6d9e1cb4d106a2fc87d9dafe517915d4de.zip
LibJS: Convert get_method to ThrowCompletionOr
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/ArrayConstructor.cpp')
-rw-r--r--Userland/Libraries/LibJS/Runtime/ArrayConstructor.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/ArrayConstructor.cpp b/Userland/Libraries/LibJS/Runtime/ArrayConstructor.cpp
index 4660d78eec..2e92962e1a 100644
--- a/Userland/Libraries/LibJS/Runtime/ArrayConstructor.cpp
+++ b/Userland/Libraries/LibJS/Runtime/ArrayConstructor.cpp
@@ -108,9 +108,7 @@ JS_DEFINE_NATIVE_FUNCTION(ArrayConstructor::from)
auto this_arg = vm.argument(2);
auto items = vm.argument(0);
- auto using_iterator = items.get_method(global_object, *vm.well_known_symbol_iterator());
- if (vm.exception())
- return {};
+ auto using_iterator = TRY_OR_DISCARD(items.get_method(global_object, *vm.well_known_symbol_iterator()));
if (using_iterator) {
Value array;
if (constructor.is_constructor()) {