mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-04 15:45:25 +00:00
LibJS: Remove a bunch of unnecessary uses of Cell::interpreter()
We'll want to get rid of all uses of this, to free up the engine from the old assumption that there's always an Interpreter available.
This commit is contained in:
@@ -67,14 +67,14 @@ BoundFunction* Function::bind(Value bound_this_value, Vector<Value> arguments)
|
||||
|
||||
i32 computed_length = 0;
|
||||
auto length_property = get("length");
|
||||
if (interpreter().exception())
|
||||
if (vm().exception())
|
||||
return nullptr;
|
||||
if (length_property.is_number())
|
||||
computed_length = max(0, length_property.as_i32() - static_cast<i32>(arguments.size()));
|
||||
|
||||
Object* constructor_prototype = nullptr;
|
||||
auto prototype_property = target_function.get("prototype");
|
||||
if (interpreter().exception())
|
||||
if (vm().exception())
|
||||
return nullptr;
|
||||
if (prototype_property.is_object())
|
||||
constructor_prototype = &prototype_property.as_object();
|
||||
@@ -82,7 +82,7 @@ BoundFunction* Function::bind(Value bound_this_value, Vector<Value> arguments)
|
||||
auto all_bound_arguments = bound_arguments();
|
||||
all_bound_arguments.append(move(arguments));
|
||||
|
||||
return interpreter().heap().allocate<BoundFunction>(global_object(), global_object(), target_function, bound_this_object, move(all_bound_arguments), computed_length, constructor_prototype);
|
||||
return heap().allocate<BoundFunction>(global_object(), global_object(), target_function, bound_this_object, move(all_bound_arguments), computed_length, constructor_prototype);
|
||||
}
|
||||
|
||||
void Function::visit_children(Visitor& visitor)
|
||||
|
||||
Reference in New Issue
Block a user