mirror of
https://github.com/RGBCube/serenity
synced 2025-05-22 17:05:10 +00:00
LibJS: Don't require Interpreter& in PropertyName and StringOrSymbol
This commit is contained in:
parent
1df18c58f5
commit
b9793e603c
5 changed files with 8 additions and 8 deletions
|
@ -1285,7 +1285,7 @@ Value AssignmentExpression::execute(Interpreter& interpreter, GlobalObject& glob
|
||||||
interpreter.vm().throw_exception<ReferenceError>(global_object, ErrorType::InvalidLeftHandAssignment);
|
interpreter.vm().throw_exception<ReferenceError>(global_object, ErrorType::InvalidLeftHandAssignment);
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
update_function_name(rhs_result, get_function_name(global_object, reference.name().to_value(interpreter)));
|
update_function_name(rhs_result, get_function_name(global_object, reference.name().to_value(interpreter.vm())));
|
||||||
reference.put(interpreter, global_object, rhs_result);
|
reference.put(interpreter, global_object, rhs_result);
|
||||||
|
|
||||||
if (interpreter.exception())
|
if (interpreter.exception())
|
||||||
|
|
|
@ -237,12 +237,12 @@ Value Object::get_own_properties(const Object& this_object, PropertyKind kind, b
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (kind == PropertyKind::Key) {
|
if (kind == PropertyKind::Key) {
|
||||||
properties_array->define_property(property_index, it.key.to_value(interpreter()));
|
properties_array->define_property(property_index, it.key.to_value(vm()));
|
||||||
} else if (kind == PropertyKind::Value) {
|
} else if (kind == PropertyKind::Value) {
|
||||||
properties_array->define_property(property_index, this_object.get(it.key));
|
properties_array->define_property(property_index, this_object.get(it.key));
|
||||||
} else {
|
} else {
|
||||||
auto* entry_array = Array::create(global_object());
|
auto* entry_array = Array::create(global_object());
|
||||||
entry_array->define_property(0, it.key.to_value(interpreter()));
|
entry_array->define_property(0, it.key.to_value(vm()));
|
||||||
entry_array->define_property(1, this_object.get(it.key));
|
entry_array->define_property(1, this_object.get(it.key));
|
||||||
properties_array->define_property(property_index, entry_array);
|
properties_array->define_property(property_index, entry_array);
|
||||||
}
|
}
|
||||||
|
|
|
@ -136,10 +136,10 @@ public:
|
||||||
return StringOrSymbol(as_symbol());
|
return StringOrSymbol(as_symbol());
|
||||||
}
|
}
|
||||||
|
|
||||||
Value to_value(Interpreter& interpreter) const
|
Value to_value(VM& vm) const
|
||||||
{
|
{
|
||||||
if (is_string())
|
if (is_string())
|
||||||
return js_string(interpreter, m_string);
|
return js_string(vm, m_string);
|
||||||
if (is_number())
|
if (is_number())
|
||||||
return Value(m_number);
|
return Value(m_number);
|
||||||
if (is_symbol())
|
if (is_symbol())
|
||||||
|
|
|
@ -279,7 +279,7 @@ bool ProxyObject::define_property(const StringOrSymbol& property_name, const Obj
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto trap_result = vm().call(trap.as_function(), Value(&m_handler), Value(&m_target), property_name.to_value(interpreter()), Value(const_cast<Object*>(&descriptor))).to_boolean();
|
auto trap_result = vm().call(trap.as_function(), Value(&m_handler), Value(&m_target), property_name.to_value(vm()), Value(const_cast<Object*>(&descriptor))).to_boolean();
|
||||||
if (vm().exception() || !trap_result)
|
if (vm().exception() || !trap_result)
|
||||||
return false;
|
return false;
|
||||||
auto target_desc = m_target.get_own_property_descriptor(property_name);
|
auto target_desc = m_target.get_own_property_descriptor(property_name);
|
||||||
|
|
|
@ -99,10 +99,10 @@ public:
|
||||||
ASSERT_NOT_REACHED();
|
ASSERT_NOT_REACHED();
|
||||||
}
|
}
|
||||||
|
|
||||||
Value to_value(Interpreter& interpreter) const
|
Value to_value(VM& vm) const
|
||||||
{
|
{
|
||||||
if (is_string())
|
if (is_string())
|
||||||
return js_string(interpreter, as_string());
|
return js_string(vm, as_string());
|
||||||
if (is_symbol())
|
if (is_symbol())
|
||||||
return const_cast<Symbol*>(as_symbol());
|
return const_cast<Symbol*>(as_symbol());
|
||||||
return {};
|
return {};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue