Index: src/objects-inl.h |
diff --git a/src/objects-inl.h b/src/objects-inl.h |
index ffc22703203d3aacae36d7e2c16efb95c6ccd321..6158a1733f8eeea520bbabf05077bb5374f651d8 100644 |
--- a/src/objects-inl.h |
+++ b/src/objects-inl.h |
@@ -1081,6 +1081,13 @@ bool Object::HasSpecificClassOf(String* name) { |
} |
+MaybeHandle<Object> Object::GetProperty(Handle<Object> object, |
+ Handle<Name> name) { |
+ PropertyAttributes attributes; |
+ return GetPropertyWithReceiver(object, object, name, &attributes); |
+} |
+ |
+ |
MaybeHandle<Object> Object::GetElement(Isolate* isolate, |
Handle<Object> object, |
uint32_t index) { |
@@ -1092,19 +1099,39 @@ MaybeHandle<Object> Object::GetElement(Isolate* isolate, |
} |
-Handle<Object> Object::GetElementNoExceptionThrown(Isolate* isolate, |
- Handle<Object> object, |
+MaybeHandle<Object> Object::GetPropertyOrElement(Handle<Object> object, |
+ Handle<Name> name) { |
+ uint32_t index; |
+ Isolate* isolate = name->GetIsolate(); |
+ if (name->AsArrayIndex(&index)) return GetElement(isolate, object, index); |
+ return GetProperty(object, name); |
+} |
+ |
+ |
+MaybeHandle<Object> JSProxy::GetElementWithHandler(Handle<JSProxy> proxy, |
+ Handle<Object> receiver, |
uint32_t index) { |
- Handle<Object> result = |
- Object::GetElementWithReceiver( |
- isolate, object, object, index).ToHandleChecked(); |
- return result; |
+ return GetPropertyWithHandler( |
+ proxy, receiver, proxy->GetIsolate()->factory()->Uint32ToString(index)); |
} |
-MaybeObject* Object::GetProperty(Name* key) { |
- PropertyAttributes attributes; |
- return GetPropertyWithReceiver(this, key, &attributes); |
+MaybeHandle<Object> JSProxy::SetElementWithHandler(Handle<JSProxy> proxy, |
+ Handle<JSReceiver> receiver, |
+ uint32_t index, |
+ Handle<Object> value, |
+ StrictMode strict_mode) { |
+ Isolate* isolate = proxy->GetIsolate(); |
+ Handle<String> name = isolate->factory()->Uint32ToString(index); |
+ return SetPropertyWithHandler( |
+ proxy, receiver, name, value, NONE, strict_mode); |
+} |
+ |
+ |
+bool JSProxy::HasElementWithHandler(Handle<JSProxy> proxy, uint32_t index) { |
+ Isolate* isolate = proxy->GetIsolate(); |
+ Handle<String> name = isolate->factory()->Uint32ToString(index); |
+ return HasPropertyWithHandler(proxy, name); |
} |
@@ -3024,15 +3051,6 @@ void Name::set_hash_field(uint32_t value) { |
} |
-Handle<Object> GlobalObject::GetPropertyNoExceptionThrown( |
- Handle<GlobalObject> global, |
- Handle<Name> name) { |
- Handle<Object> result = Object::GetProperty(global, name); |
- CHECK_NOT_EMPTY_HANDLE(name->GetIsolate(), result); |
- return result; |
-} |
- |
- |
bool Name::Equals(Name* other) { |
if (other == this) return true; |
if ((this->IsInternalizedString() && other->IsInternalizedString()) || |