mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:37:34 +00:00
LibJS: Correct the handling of accessors on strings
This commit is contained in:
parent
77511627e9
commit
44a2ebea00
2 changed files with 307 additions and 2 deletions
|
@ -65,10 +65,15 @@ ThrowCompletionOr<Value> Reference::get_value(GlobalObject& global_object) const
|
|||
if (is_property_reference()) {
|
||||
auto* base_obj = TRY(m_base_value.to_object(global_object));
|
||||
|
||||
if (is_private_reference())
|
||||
if (is_private_reference()) {
|
||||
// FIXME: We need to be able to specify the receiver for this
|
||||
// if we want to use it in error messages in future
|
||||
// as things currently stand this does the "wrong thing" but
|
||||
// the error is unobservable
|
||||
return base_obj->private_get(m_private_name);
|
||||
}
|
||||
|
||||
return base_obj->get(m_name);
|
||||
return base_obj->internal_get(m_name, m_base_value);
|
||||
}
|
||||
|
||||
VERIFY(m_base_type == BaseType::Environment);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue