mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:28:12 +00:00
LibJS: Interpreter::this_value() => this_value(GlobalObject&)
Once the Interpreter has no global object attached to it, we have to provide it everywhere.
This commit is contained in:
parent
25f2a29d84
commit
053863f35e
25 changed files with 78 additions and 73 deletions
|
@ -49,9 +49,9 @@ Array::~Array()
|
|||
{
|
||||
}
|
||||
|
||||
Array* array_from(Interpreter& interpreter)
|
||||
Array* array_from(Interpreter& interpreter, GlobalObject& global_object)
|
||||
{
|
||||
auto* this_object = interpreter.this_value().to_object(interpreter);
|
||||
auto* this_object = interpreter.this_value(global_object).to_object(interpreter);
|
||||
if (!this_object)
|
||||
return {};
|
||||
if (!this_object->is_array()) {
|
||||
|
@ -63,7 +63,7 @@ Array* array_from(Interpreter& interpreter)
|
|||
|
||||
Value Array::length_getter(Interpreter& interpreter)
|
||||
{
|
||||
auto* array = array_from(interpreter);
|
||||
auto* array = array_from(interpreter, interpreter.global_object());
|
||||
if (!array)
|
||||
return {};
|
||||
return Value(static_cast<i32>(array->indexed_properties().array_like_size()));
|
||||
|
@ -71,7 +71,7 @@ Value Array::length_getter(Interpreter& interpreter)
|
|||
|
||||
void Array::length_setter(Interpreter& interpreter, Value value)
|
||||
{
|
||||
auto* array = array_from(interpreter);
|
||||
auto* array = array_from(interpreter, interpreter.global_object());
|
||||
if (!array)
|
||||
return;
|
||||
auto length = value.to_number(interpreter);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue