From 0b799dd3b74ef46902b6b080f27726af1159d367 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Fri, 26 Mar 2021 19:40:55 +0100 Subject: [PATCH] LibJS: VERIFY(!this_value.is_empty()) in VM::call_internal() Just a sanity check, this must never happen. Manual invocations of call() e.g. in LibWeb bindings must pass js_undefined() if no specific this value is desired, which OrdinaryCallBindThis will then use as-is or turn into the global this value in non-strict mode. --- Userland/Libraries/LibJS/Runtime/VM.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Userland/Libraries/LibJS/Runtime/VM.cpp b/Userland/Libraries/LibJS/Runtime/VM.cpp index 38e4a395fc..dc7a43ab75 100644 --- a/Userland/Libraries/LibJS/Runtime/VM.cpp +++ b/Userland/Libraries/LibJS/Runtime/VM.cpp @@ -336,6 +336,7 @@ Value VM::get_new_target() const Value VM::call_internal(Function& function, Value this_value, Optional arguments) { VERIFY(!exception()); + VERIFY(!this_value.is_empty()); CallFrame call_frame; call_frame.callee = &function;