Index: src/objects-inl.h |
diff --git a/src/objects-inl.h b/src/objects-inl.h |
index 9112702685a5a70c4821e22e764f29da967b5f62..cd47b5e62b0944d7fa7c12591de6b429721322a5 100644 |
--- a/src/objects-inl.h |
+++ b/src/objects-inl.h |
@@ -1053,6 +1053,13 @@ MaybeHandle<Object> Object::GetProperty(Handle<Object> object, |
return GetProperty(&it); |
} |
+MaybeHandle<Object> JSReceiver::GetProperty(Handle<JSReceiver> receiver, |
+ Handle<Name> name) { |
+ LookupIterator it(receiver, name, receiver); |
+ if (!it.IsFound()) return it.factory()->undefined_value(); |
+ return Object::GetProperty(&it); |
+} |
+ |
MaybeHandle<Object> Object::GetElement(Isolate* isolate, Handle<Object> object, |
uint32_t index) { |
LookupIterator it(isolate, object, index); |
@@ -1060,6 +1067,14 @@ MaybeHandle<Object> Object::GetElement(Isolate* isolate, Handle<Object> object, |
return GetProperty(&it); |
} |
+MaybeHandle<Object> JSReceiver::GetElement(Isolate* isolate, |
+ Handle<JSReceiver> receiver, |
+ uint32_t index) { |
+ LookupIterator it(isolate, receiver, index, receiver); |
+ if (!it.IsFound()) return it.factory()->undefined_value(); |
+ return Object::GetProperty(&it); |
+} |
+ |
Handle<Object> JSReceiver::GetDataProperty(Handle<JSReceiver> object, |
Handle<Name> name) { |
LookupIterator it(object, name, object, |
@@ -1090,10 +1105,11 @@ MaybeHandle<Object> JSReceiver::GetPrototype(Isolate* isolate, |
return PrototypeIterator::GetCurrent(iter); |
} |
-MaybeHandle<Object> Object::GetProperty(Isolate* isolate, Handle<Object> object, |
- const char* name) { |
+MaybeHandle<Object> JSReceiver::GetProperty(Isolate* isolate, |
+ Handle<JSReceiver> receiver, |
+ const char* name) { |
Handle<String> str = isolate->factory()->InternalizeUtf8String(name); |
- return GetProperty(object, str); |
+ return GetProperty(receiver, str); |
} |