1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-20 12:15:07 +00:00

LibJS: Make Function::call() not require an Interpreter&

This makes a difference inside ScriptFunction::call(), which will now
instantiate a temporary Interpreter if one is not attached to the VM.
This commit is contained in:
Andreas Kling 2020-09-27 17:24:14 +02:00
parent be31805e8b
commit 1ff9d33131
42 changed files with 167 additions and 142 deletions

View file

@ -870,20 +870,20 @@ Value Object::invoke(const StringOrSymbol& property_name, Optional<MarkedValueLi
Value Object::call_native_property_getter(Object* this_object, Value property) const
{
ASSERT(property.is_native_property());
auto& call_frame = interpreter().vm().push_call_frame();
auto& call_frame = vm().push_call_frame();
call_frame.this_value = this_object;
auto result = property.as_native_property().get(interpreter(), global_object());
interpreter().vm().pop_call_frame();
vm().pop_call_frame();
return result;
}
void Object::call_native_property_setter(Object* this_object, Value property, Value value) const
{
ASSERT(property.is_native_property());
auto& call_frame = interpreter().vm().push_call_frame();
auto& call_frame = vm().push_call_frame();
call_frame.this_value = this_object;
property.as_native_property().set(interpreter(), global_object(), value);
interpreter().vm().pop_call_frame();
vm().pop_call_frame();
}
}