diff options
Diffstat (limited to 'Libraries/LibJS/Interpreter.cpp')
-rw-r--r-- | Libraries/LibJS/Interpreter.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Libraries/LibJS/Interpreter.cpp b/Libraries/LibJS/Interpreter.cpp index 24fdb5f49d..3dcc3ec250 100644 --- a/Libraries/LibJS/Interpreter.cpp +++ b/Libraries/LibJS/Interpreter.cpp @@ -30,6 +30,7 @@ #include <LibJS/Runtime/Error.h> #include <LibJS/Runtime/GlobalObject.h> #include <LibJS/Runtime/LexicalEnvironment.h> +#include <LibJS/Runtime/MarkedValueList.h> #include <LibJS/Runtime/NativeFunction.h> #include <LibJS/Runtime/Object.h> #include <LibJS/Runtime/Shape.h> @@ -177,12 +178,13 @@ void Interpreter::gather_roots(Badge<Heap>, HashTable<Cell*>& roots) } } -Value Interpreter::call(Function* function, Value this_value, const Vector<Value>& arguments) +Value Interpreter::call(Function* function, Value this_value, Optional<MarkedValueList> arguments) { auto& call_frame = push_call_frame(); call_frame.function_name = function->name(); call_frame.this_value = this_value; - call_frame.arguments = arguments; + if (arguments.has_value()) + call_frame.arguments = arguments.value().values(); call_frame.environment = function->create_environment(); auto result = function->call(*this); pop_call_frame(); |