Bladeren bron

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.
Linus Groh 4 jaren geleden
bovenliggende
commit
0b799dd3b7
1 gewijzigde bestanden met toevoegingen van 1 en 0 verwijderingen
  1. 1 0
      Userland/Libraries/LibJS/Runtime/VM.cpp

+ 1 - 0
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<MarkedValueList> arguments)
 {
     VERIFY(!exception());
+    VERIFY(!this_value.is_empty());
 
     CallFrame call_frame;
     call_frame.callee = &function;