summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Runtime/FunctionEnvironment.cpp
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2021-12-28 23:50:23 +0100
committerLinus Groh <mail@linusgroh.de>2021-12-29 00:16:51 +0100
commit451149df0b6ea94ea3aa0c1d630334c998ebc9d0 (patch)
treedd6a9099ae8b229c55ff96c2995c0d7c023b5d06 /Userland/Libraries/LibJS/Runtime/FunctionEnvironment.cpp
parent8d70a50aed89d9931ce7864b26734a01a9423f1c (diff)
downloadserenity-451149df0b6ea94ea3aa0c1d630334c998ebc9d0.zip
LibJS: Ensure get_new_target() never returns an empty value
Also add spec comments and remove a redundant exception check while we're here :^)
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/FunctionEnvironment.cpp')
-rw-r--r--Userland/Libraries/LibJS/Runtime/FunctionEnvironment.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/FunctionEnvironment.cpp b/Userland/Libraries/LibJS/Runtime/FunctionEnvironment.cpp
index 198189515c..072e1b4681 100644
--- a/Userland/Libraries/LibJS/Runtime/FunctionEnvironment.cpp
+++ b/Userland/Libraries/LibJS/Runtime/FunctionEnvironment.cpp
@@ -81,6 +81,8 @@ ThrowCompletionOr<Value> FunctionEnvironment::get_this_binding(GlobalObject& glo
// 9.1.1.3.1 BindThisValue ( V ), https://tc39.es/ecma262/#sec-bindthisvalue
ThrowCompletionOr<Value> FunctionEnvironment::bind_this_value(GlobalObject& global_object, Value this_value)
{
+ VERIFY(!this_value.is_empty());
+
// 1. Assert: envRec.[[ThisBindingStatus]] is not lexical.
VERIFY(m_this_binding_status != ThisBindingStatus::Lexical);