summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorIdan Horowitz <idan.horowitz@gmail.com>2021-04-17 18:21:51 +0300
committerLinus Groh <mail@linusgroh.de>2021-04-17 17:38:50 +0200
commit79b1270711b7038eb8de6ef108cd3ca132abbc32 (patch)
treeff99b4ff12ba7aedd5e21198cc422410da8df809 /Userland
parent40c2c249846548c42310f3a9eab29efcf69bc4cd (diff)
downloadserenity-79b1270711b7038eb8de6ef108cd3ca132abbc32.zip
LibJS: Take reference instead of pointer in prepare_arguments_list
This argument is always non-null (and the function assumes so), so theres no point to taking a pointer instead of a reference.
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibJS/Runtime/ReflectObject.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/ReflectObject.cpp b/Userland/Libraries/LibJS/Runtime/ReflectObject.cpp
index eec0f113f9..a0c50d1eb4 100644
--- a/Userland/Libraries/LibJS/Runtime/ReflectObject.cpp
+++ b/Userland/Libraries/LibJS/Runtime/ReflectObject.cpp
@@ -56,7 +56,7 @@ static Function* get_target_function_from(GlobalObject& global_object, const Str
return &target.as_function();
}
-static void prepare_arguments_list(GlobalObject& global_object, Value value, MarkedValueList* arguments)
+static void prepare_arguments_list(GlobalObject& global_object, Value value, MarkedValueList& arguments)
{
auto& vm = global_object.vm();
if (!value.is_object()) {
@@ -71,7 +71,7 @@ static void prepare_arguments_list(GlobalObject& global_object, Value value, Mar
auto element = arguments_list.get(String::number(i));
if (vm.exception())
return;
- arguments->append(element.value_or(js_undefined()));
+ arguments.append(element.value_or(js_undefined()));
}
}
@@ -111,7 +111,7 @@ JS_DEFINE_NATIVE_FUNCTION(ReflectObject::apply)
return {};
auto this_arg = vm.argument(1);
MarkedValueList arguments(vm.heap());
- prepare_arguments_list(global_object, vm.argument(2), &arguments);
+ prepare_arguments_list(global_object, vm.argument(2), arguments);
if (vm.exception())
return {};
return vm.call(*target, this_arg, move(arguments));
@@ -123,7 +123,7 @@ JS_DEFINE_NATIVE_FUNCTION(ReflectObject::construct)
if (!target)
return {};
MarkedValueList arguments(vm.heap());
- prepare_arguments_list(global_object, vm.argument(1), &arguments);
+ prepare_arguments_list(global_object, vm.argument(1), arguments);
if (vm.exception())
return {};
auto* new_target = target;