Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index 940120541e4ca51be3861fa72dca83c97b44fa80..bb2f2d3d3bb52a3270f896bd39bda9f0484a2767 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -4694,7 +4694,7 @@ Object* JSObject::LookupAccessor(String* name, AccessorComponent component) { |
Object* element = dictionary->ValueAt(entry); |
if (dictionary->DetailsAt(entry).type() == CALLBACKS && |
element->IsAccessorPair()) { |
- return AccessorPair::cast(element)->get(component); |
+ return AccessorPair::cast(element)->SafeGet(component); |
} |
} |
} |
@@ -4710,7 +4710,7 @@ Object* JSObject::LookupAccessor(String* name, AccessorComponent component) { |
if (result.type() == CALLBACKS) { |
Object* obj = result.GetCallbackObject(); |
if (obj->IsAccessorPair()) { |
- return AccessorPair::cast(obj)->get(component); |
+ return AccessorPair::cast(obj)->SafeGet(component); |
} |
} |
} |
@@ -5947,6 +5947,12 @@ MaybeObject* AccessorPair::CopyWithoutTransitions() { |
} |
+Object* AccessorPair::SafeGet(AccessorComponent component) { |
+ Object* accessor = get(component); |
+ return accessor->IsTheHole() ? GetHeap()->undefined_value() : accessor; |
+} |
+ |
+ |
MaybeObject* DeoptimizationInputData::Allocate(int deopt_entry_count, |
PretenureFlag pretenure) { |
ASSERT(deopt_entry_count > 0); |