Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index 26ab64552fc344fff7be569d3f43b365650c4d6f..94ee4ece8bbda91524defc5363edc1daabac5bcf 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -2639,6 +2639,27 @@ PropertyAttributes JSReceiver::GetPropertyAttribute(JSReceiver* receiver, |
} |
+PropertyAttributes JSReceiver::TryGetPropertyAttribute( |
+ Handle<Object> key, |
+ bool* has_pending_exception) { |
+ Isolate* isolate = GetIsolate(); |
+ HandleScope scope(isolate); |
+ Handle<String> name; |
+ if (key->IsString()) { |
+ name = Handle<String>::cast(key); |
+ } else { |
+ Handle<Object> converted = |
+ Execution::ToString(key, has_pending_exception); |
+ if (*has_pending_exception) return NONE; |
+ name = Handle<String>::cast(converted); |
+ } |
+ PropertyAttributes attr = GetPropertyAttributeWithReceiver(this, *name); |
+ // Returns NONE when the property doesn't exist. |
+ if (attr == ABSENT) return NONE; |
+ return attr; |
+} |
+ |
+ |
PropertyAttributes JSReceiver::GetLocalPropertyAttribute(String* name) { |
// Check whether the name is an array index. |
uint32_t index = 0; |