diff options
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/Value.cpp')
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/Value.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/Value.cpp b/Userland/Libraries/LibJS/Runtime/Value.cpp index a622beb72c..e626eb401a 100644 --- a/Userland/Libraries/LibJS/Runtime/Value.cpp +++ b/Userland/Libraries/LibJS/Runtime/Value.cpp @@ -258,7 +258,7 @@ bool Value::is_regexp(GlobalObject& global_object) const auto matcher = as_object().get(*vm.well_known_symbol_match()); if (vm.exception()) return false; - if (!matcher.is_empty() && !matcher.is_undefined()) + if (!matcher.is_undefined()) return matcher.to_boolean(); return is<RegExpObject>(as_object()); @@ -807,7 +807,7 @@ Value Value::get(GlobalObject& global_object, PropertyName const& property_name) return {}; // 3. Return ? O.[[Get]](P, V). - return object->get(property_name, *this); + return object->internal_get(property_name, *this); } // 7.3.10 GetMethod ( V, P ), https://tc39.es/ecma262/#sec-getmethod @@ -819,7 +819,7 @@ FunctionObject* Value::get_method(GlobalObject& global_object, PropertyName cons VERIFY(property_name.is_valid()); // 2. Let func be ? GetV(V, P). - auto function = get(global_object, property_name).value_or(js_undefined()); + auto function = get(global_object, property_name); if (vm.exception()) return nullptr; @@ -1252,6 +1252,7 @@ Value instance_of(GlobalObject& global_object, Value lhs, Value rhs) return ordinary_has_instance(global_object, lhs, rhs); } +// 7.3.21 OrdinaryHasInstance ( C, O ), https://tc39.es/ecma262/#sec-ordinaryhasinstance Value ordinary_has_instance(GlobalObject& global_object, Value lhs, Value rhs) { auto& vm = global_object.vm(); @@ -1277,7 +1278,7 @@ Value ordinary_has_instance(GlobalObject& global_object, Value lhs, Value rhs) return {}; } while (true) { - lhs_object = lhs_object->prototype(); + lhs_object = lhs_object->internal_get_prototype_of(); if (vm.exception()) return {}; if (!lhs_object) |