Fixed some details in GetPropertyAttributeWithFailedAccessCheck
authorolehougaard <olehougaard@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 31 Oct 2008 10:11:39 +0000 (10:11 +0000)
committerolehougaard <olehougaard@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 31 Oct 2008 10:11:39 +0000 (10:11 +0000)
Review URL: http://codereview.chromium.org/8959

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@667 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/objects.cc

index ad1f325641fcb5eb68144eb086dafb90e38dd01d..c78c65a7354bb279103a54f69b33350c05b395ea 100644 (file)
@@ -288,10 +288,11 @@ PropertyAttributes JSObject::GetPropertyAttributeWithFailedAccessCheck(
       case NORMAL:
       case FIELD:
       case CONSTANT_FUNCTION: {
+        if (!continue_search) break;
         // Search ALL_CAN_READ accessors in prototype chain.
         LookupResult r;
         result->holder()->LookupRealNamedPropertyInPrototypes(name, &r);
-        if (r.IsValid() && continue_search) {
+        if (r.IsValid()) {
           return GetPropertyAttributeWithFailedAccessCheck(receiver,
                                                            &r,
                                                            name,
@@ -304,8 +305,12 @@ PropertyAttributes JSObject::GetPropertyAttributeWithFailedAccessCheck(
         // If the object has an interceptor, try real named properties.
         // No access check in GetPropertyAttributeWithInterceptor.
         LookupResult r;
-        result->holder()->LookupRealNamedProperty(name, &r);
-        if (r.IsValid() && continue_search) {
+        if (continue_search) {
+          result->holder()->LookupRealNamedProperty(name, &r);
+        } else {
+          result->holder()->LocalLookupRealNamedProperty(name, &r);
+        }
+        if (r.IsValid()) {
           return GetPropertyAttributeWithFailedAccessCheck(receiver,
                                                            &r,
                                                            name,