diff options
Diffstat (limited to 'Libraries/LibJS/Interpreter.cpp')
-rw-r--r-- | Libraries/LibJS/Interpreter.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Libraries/LibJS/Interpreter.cpp b/Libraries/LibJS/Interpreter.cpp index 8f36fe58e2..6c6b1563f2 100644 --- a/Libraries/LibJS/Interpreter.cpp +++ b/Libraries/LibJS/Interpreter.cpp @@ -161,4 +161,14 @@ void Interpreter::gather_roots(Badge<Heap>, HashTable<Cell*>& roots) } } +Value Interpreter::call(Function* function, Value this_value, const Vector<Value>& arguments) +{ + auto& call_frame = push_call_frame(); + call_frame.this_value = this_value; + call_frame.arguments = arguments; + auto result = function->call(*this, call_frame.arguments); + pop_call_frame(); + return result; +} + } |