mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-05 16:14:38 +00:00
LibJS+LibWeb: Remove a bunch of calls to Interpreter::global_object()
Objects should get the GlobalObject from themselves instead. However, it's not yet available during construction so this only switches code that happens after construction. To support multiple global objects, Interpreter needs to stop holding on to "the" global object and let each object graph own their global.
This commit is contained in:
@@ -104,7 +104,7 @@ Value ScriptFunction::call(Interpreter& interpreter)
|
||||
auto parameter = parameters()[i];
|
||||
auto value = js_undefined();
|
||||
if (parameter.is_rest) {
|
||||
auto* array = Array::create(interpreter.global_object());
|
||||
auto* array = Array::create(global_object());
|
||||
for (size_t rest_index = i; rest_index < argument_values.size(); ++rest_index)
|
||||
array->indexed_properties().append(argument_values[rest_index]);
|
||||
value = Value(array);
|
||||
|
||||
Reference in New Issue
Block a user