diff --git a/Libraries/LibJS/Runtime/NativeFunction.cpp b/Libraries/LibJS/Runtime/NativeFunction.cpp index a111a22c9b..7f02afd6ac 100644 --- a/Libraries/LibJS/Runtime/NativeFunction.cpp +++ b/Libraries/LibJS/Runtime/NativeFunction.cpp @@ -42,8 +42,11 @@ NativeFunction::~NativeFunction() Value NativeFunction::call(Interpreter& interpreter, const Vector& arguments) { auto this_value = interpreter.this_value(); - ASSERT(this_value.is_object()); - return m_native_function(this_value.as_object(), arguments); + // FIXME: Why are we here with a non-object 'this'? + Object* this_object = nullptr; + if (this_value.is_object()) + this_object = this_value.as_object(); + return m_native_function(this_object, arguments); } }