diff --git a/src/property.h b/src/property.h index 125f927e9b..ab2dcef808 100644 --- a/src/property.h +++ b/src/property.h @@ -252,8 +252,7 @@ class LookupResult V8_FINAL BASE_EMBEDDED { } bool IsNormal() const { - DCHECK(!(details_.type() == NORMAL && !IsFound())); - return IsDescriptorOrDictionary() && type() == NORMAL; + return IsFound() && IsDescriptorOrDictionary() && type() == NORMAL; } bool IsConstant() const { diff --git a/src/runtime.cc b/src/runtime.cc index dc3fc756c1..3ebd6b5b7e 100644 --- a/src/runtime.cc +++ b/src/runtime.cc @@ -5027,15 +5027,12 @@ RUNTIME_FUNCTION(Runtime_DefineDataPropertyUnchecked) { return isolate->heap()->undefined_value(); } - LookupResult lookup(isolate); - js_object->LookupOwnRealNamedProperty(name, &lookup); + LookupIterator it(js_object, name, LookupIterator::CHECK_PROPERTY); // Take special care when attributes are different and there is already - // a property. For simplicity we normalize the property which enables us - // to not worry about changing the instance_descriptor and creating a new - // map. - if (lookup.IsFound() && - (attr != lookup.GetAttributes() || lookup.IsPropertyCallbacks())) { + // a property. + if (it.IsFound() && it.HasProperty() && + it.property_kind() == LookupIterator::ACCESSOR) { // Use IgnoreAttributes version since a readonly property may be // overridden and SetProperty does not allow this. Handle result;