Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index 400be3edaebb01269d94481d7b0e7c59c2043e3e..9dfb12e928b11299e6329ea99b56eb51efd6a2ec 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -6402,27 +6402,14 @@ MaybeHandle<Object> JSObject::DefineAccessor(Handle<JSObject> object, |
!isolate->IsInternallyUsedPropertyName(name); |
bool preexists = false; |
if (is_observed) { |
- if (is_element) { |
- Maybe<bool> maybe = HasOwnElement(object, index); |
- // Workaround for a GCC 4.4.3 bug which leads to "‘preexists’ may be used |
- // uninitialized in this function". |
- if (!maybe.IsJust()) { |
- DCHECK(false); |
- return isolate->factory()->undefined_value(); |
- } |
- preexists = maybe.FromJust(); |
- if (preexists && GetOwnElementAccessorPair(object, index).is_null()) { |
- old_value = |
- Object::GetElement(isolate, object, index).ToHandleChecked(); |
- } |
- } else { |
- LookupIterator it(object, name, LookupIterator::HIDDEN_SKIP_INTERCEPTOR); |
- CHECK(GetPropertyAttributes(&it).IsJust()); |
- preexists = it.IsFound(); |
- if (preexists && (it.state() == LookupIterator::DATA || |
- it.GetAccessors()->IsAccessorInfo())) { |
- old_value = GetProperty(&it).ToHandleChecked(); |
- } |
+ LookupIterator::Configuration c = LookupIterator::HIDDEN_SKIP_INTERCEPTOR; |
+ LookupIterator it = is_element ? LookupIterator(isolate, object, index, c) |
+ : LookupIterator(object, name, c); |
+ CHECK(GetPropertyAttributes(&it).IsJust()); |
Jakob Kummerow
2015/06/11 11:14:28
I'm not a fan of having a Release-mode CHECK here,
|
+ preexists = it.IsFound(); |
+ if (preexists && (it.state() == LookupIterator::DATA || |
+ it.GetAccessors()->IsAccessorInfo())) { |
+ old_value = GetProperty(&it).ToHandleChecked(); |
} |
} |