mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:28:11 +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:
parent
591b7b7031
commit
063acda76e
9 changed files with 13 additions and 21 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue