summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Runtime/Reference.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/Reference.cpp')
-rw-r--r--Userland/Libraries/LibJS/Runtime/Reference.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/Reference.cpp b/Userland/Libraries/LibJS/Runtime/Reference.cpp
index d94148398c..dbf23f5419 100644
--- a/Userland/Libraries/LibJS/Runtime/Reference.cpp
+++ b/Userland/Libraries/LibJS/Runtime/Reference.cpp
@@ -86,7 +86,6 @@ Completion Reference::throw_reference_error(VM& vm) const
ThrowCompletionOr<Value> Reference::get_value(VM& vm) const
{
auto& realm = *vm.current_realm();
- auto& global_object = realm.global_object();
// 1. ReturnIfAbrupt(V).
// 2. If V is not a Reference Record, return V.
@@ -119,11 +118,11 @@ ThrowCompletionOr<Value> Reference::get_value(VM& vm) const
auto string_value = m_base_value.as_string().get(vm, m_name);
if (string_value.has_value())
return *string_value;
- base_obj = global_object.string_prototype();
+ base_obj = realm.global_object().string_prototype();
} else if (m_base_value.is_number())
- base_obj = global_object.number_prototype();
+ base_obj = realm.global_object().number_prototype();
else if (m_base_value.is_boolean())
- base_obj = global_object.boolean_prototype();
+ base_obj = realm.global_object().boolean_prototype();
else
base_obj = TRY(m_base_value.to_object(vm));