1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 05:38:11 +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

@ -157,12 +157,12 @@ DateConstructor::~DateConstructor()
{
}
Value DateConstructor::call(Interpreter& interpreter)
Value DateConstructor::call()
{
auto date = construct(interpreter, *this);
auto date = construct(interpreter(), *this);
if (!date.is_object())
return {};
return js_string(interpreter, static_cast<Date&>(date.as_object()).string());
return js_string(heap(), static_cast<Date&>(date.as_object()).string());
}
Value DateConstructor::construct(Interpreter& interpreter, Function&)