diff options
author | Andreas Kling <kling@serenityos.org> | 2020-09-27 19:55:21 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-09-27 20:26:58 +0200 |
commit | b9793e603c2e3f975a93ffe873fae632dd29c9b5 (patch) | |
tree | a107874bae48dbbcf950ef79c1c6848fd022bf6a /Libraries/LibJS | |
parent | 1df18c58f52d02f65de49f268c2839cb0e7bb977 (diff) | |
download | serenity-b9793e603c2e3f975a93ffe873fae632dd29c9b5.zip |
LibJS: Don't require Interpreter& in PropertyName and StringOrSymbol
Diffstat (limited to 'Libraries/LibJS')
-rw-r--r-- | Libraries/LibJS/AST.cpp | 2 | ||||
-rw-r--r-- | Libraries/LibJS/Runtime/Object.cpp | 4 | ||||
-rw-r--r-- | Libraries/LibJS/Runtime/PropertyName.h | 4 | ||||
-rw-r--r-- | Libraries/LibJS/Runtime/ProxyObject.cpp | 2 | ||||
-rw-r--r-- | Libraries/LibJS/Runtime/StringOrSymbol.h | 4 |
5 files changed, 8 insertions, 8 deletions
diff --git a/Libraries/LibJS/AST.cpp b/Libraries/LibJS/AST.cpp index df1a3be351..0313c0aa57 100644 --- a/Libraries/LibJS/AST.cpp +++ b/Libraries/LibJS/AST.cpp @@ -1285,7 +1285,7 @@ Value AssignmentExpression::execute(Interpreter& interpreter, GlobalObject& glob interpreter.vm().throw_exception<ReferenceError>(global_object, ErrorType::InvalidLeftHandAssignment); 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); if (interpreter.exception()) diff --git a/Libraries/LibJS/Runtime/Object.cpp b/Libraries/LibJS/Runtime/Object.cpp index 0e1f02babd..c6ad4dbc04 100644 --- a/Libraries/LibJS/Runtime/Object.cpp +++ b/Libraries/LibJS/Runtime/Object.cpp @@ -237,12 +237,12 @@ Value Object::get_own_properties(const Object& this_object, PropertyKind kind, b continue; 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) { properties_array->define_property(property_index, this_object.get(it.key)); } else { 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)); properties_array->define_property(property_index, entry_array); } diff --git a/Libraries/LibJS/Runtime/PropertyName.h b/Libraries/LibJS/Runtime/PropertyName.h index 76c25eb9d0..4c74c9de9f 100644 --- a/Libraries/LibJS/Runtime/PropertyName.h +++ b/Libraries/LibJS/Runtime/PropertyName.h @@ -136,10 +136,10 @@ public: return StringOrSymbol(as_symbol()); } - Value to_value(Interpreter& interpreter) const + Value to_value(VM& vm) const { if (is_string()) - return js_string(interpreter, m_string); + return js_string(vm, m_string); if (is_number()) return Value(m_number); if (is_symbol()) diff --git a/Libraries/LibJS/Runtime/ProxyObject.cpp b/Libraries/LibJS/Runtime/ProxyObject.cpp index 1654ad4005..fa25099e35 100644 --- a/Libraries/LibJS/Runtime/ProxyObject.cpp +++ b/Libraries/LibJS/Runtime/ProxyObject.cpp @@ -279,7 +279,7 @@ bool ProxyObject::define_property(const StringOrSymbol& property_name, const Obj 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) return false; auto target_desc = m_target.get_own_property_descriptor(property_name); diff --git a/Libraries/LibJS/Runtime/StringOrSymbol.h b/Libraries/LibJS/Runtime/StringOrSymbol.h index 3027aca0cd..ea66d2fcd0 100644 --- a/Libraries/LibJS/Runtime/StringOrSymbol.h +++ b/Libraries/LibJS/Runtime/StringOrSymbol.h @@ -99,10 +99,10 @@ public: ASSERT_NOT_REACHED(); } - Value to_value(Interpreter& interpreter) const + Value to_value(VM& vm) const { if (is_string()) - return js_string(interpreter, as_string()); + return js_string(vm, as_string()); if (is_symbol()) return const_cast<Symbol*>(as_symbol()); return {}; |