summaryrefslogtreecommitdiff
path: root/Libraries/LibJS/Runtime/ScriptFunction.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Libraries/LibJS/Runtime/ScriptFunction.cpp')
-rw-r--r--Libraries/LibJS/Runtime/ScriptFunction.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/Libraries/LibJS/Runtime/ScriptFunction.cpp b/Libraries/LibJS/Runtime/ScriptFunction.cpp
index bad20ee5e9..ccc524eb6b 100644
--- a/Libraries/LibJS/Runtime/ScriptFunction.cpp
+++ b/Libraries/LibJS/Runtime/ScriptFunction.cpp
@@ -35,13 +35,13 @@
namespace JS {
-static ScriptFunction* typed_this(Interpreter& interpreter, GlobalObject& global_object)
+static ScriptFunction* typed_this(VM& vm, GlobalObject& global_object)
{
- auto* this_object = interpreter.this_value(global_object).to_object(interpreter, global_object);
+ auto* this_object = vm.this_value(global_object).to_object(global_object);
if (!this_object)
return nullptr;
if (!this_object->is_function()) {
- interpreter.vm().throw_exception<TypeError>(global_object, ErrorType::NotAFunctionNoParam);
+ vm.throw_exception<TypeError>(global_object, ErrorType::NotAFunctionNoParam);
return nullptr;
}
return static_cast<ScriptFunction*>(this_object);
@@ -154,7 +154,7 @@ Value ScriptFunction::construct(Interpreter&, Function&)
JS_DEFINE_NATIVE_GETTER(ScriptFunction::length_getter)
{
- auto* function = typed_this(interpreter, global_object);
+ auto* function = typed_this(vm, global_object);
if (!function)
return {};
return Value(static_cast<i32>(function->m_function_length));
@@ -162,10 +162,10 @@ JS_DEFINE_NATIVE_GETTER(ScriptFunction::length_getter)
JS_DEFINE_NATIVE_GETTER(ScriptFunction::name_getter)
{
- auto* function = typed_this(interpreter, global_object);
+ auto* function = typed_this(vm, global_object);
if (!function)
return {};
- return js_string(interpreter, function->name().is_null() ? "" : function->name());
+ return js_string(vm, function->name().is_null() ? "" : function->name());
}
}