summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Runtime/FunctionObject.cpp
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2022-02-09 19:19:26 +0000
committerLinus Groh <mail@linusgroh.de>2022-02-09 23:31:34 +0000
commitf663c7d6da116454b8b49d999474141afd156b0a (patch)
tree7a45439460e76fef659c021e06c52313ec5797c5 /Userland/Libraries/LibJS/Runtime/FunctionObject.cpp
parentc6c3e2a7fd5970984e521a420bf25a48ecc9171e (diff)
downloadserenity-f663c7d6da116454b8b49d999474141afd156b0a.zip
LibJS: Remove unused BoundFunction::m_constructor_prototype
This was not being used anywhere, and the way we determined it was not matching the spec at all, so let's remove it and do it properly.
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/FunctionObject.cpp')
-rw-r--r--Userland/Libraries/LibJS/Runtime/FunctionObject.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/FunctionObject.cpp b/Userland/Libraries/LibJS/Runtime/FunctionObject.cpp
index 1dd175d2e2..f7a448b5a4 100644
--- a/Userland/Libraries/LibJS/Runtime/FunctionObject.cpp
+++ b/Userland/Libraries/LibJS/Runtime/FunctionObject.cpp
@@ -117,17 +117,12 @@ ThrowCompletionOr<BoundFunction*> FunctionObject::bind(Value bound_this_value, V
if (length_property.is_number())
computed_length = max(0, length_property.as_i32() - static_cast<i32>(arguments.size()));
- Object* constructor_prototype = nullptr;
- auto prototype_property = TRY(target_function.get(vm.names.prototype));
- if (prototype_property.is_object())
- constructor_prototype = &prototype_property.as_object();
-
Vector<Value> all_bound_arguments;
if (is<BoundFunction>(*this))
all_bound_arguments.extend(static_cast<BoundFunction&>(*this).bound_arguments());
all_bound_arguments.extend(move(arguments));
- return heap().allocate<BoundFunction>(global_object(), global_object(), target_function, bound_this_object, move(all_bound_arguments), computed_length, constructor_prototype);
+ return heap().allocate<BoundFunction>(global_object(), global_object(), target_function, bound_this_object, move(all_bound_arguments), computed_length);
}
}