mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 20:15:17 +00:00
LibJS: Tolerate NativeFunction::call() with non-object 'this' for now
I'm not exactly sure why we end up in this situation, we'll have to look into it.
This commit is contained in:
parent
f64f7a4787
commit
97674da502
Notes:
sideshowbarker
2024-07-19 08:15:32 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/97674da5029
1 changed files with 5 additions and 2 deletions
|
@ -42,8 +42,11 @@ NativeFunction::~NativeFunction()
|
|||
Value NativeFunction::call(Interpreter& interpreter, const Vector<Value>& 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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue