Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1362)

Unified Diff: src/objects.cc

Issue 13242: Make sure to set property attributes in GetProperty in the case of... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/objects.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
===================================================================
--- src/objects.cc (revision 923)
+++ src/objects.cc (working copy)
@@ -147,7 +147,9 @@
PropertyAttributes* attributes) {
LookupResult result;
Lookup(name, &result);
- return GetProperty(receiver, &result, name, attributes);
+ Object* value = GetProperty(receiver, &result, name, attributes);
+ ASSERT(*attributes <= ABSENT);
+ return value;
}
@@ -215,9 +217,11 @@
// Only deal with CALLBACKS and INTERCEPTOR
-Object* JSObject::GetPropertyWithFailedAccessCheck(Object* receiver,
- LookupResult* result,
- String* name) {
+Object* JSObject::GetPropertyWithFailedAccessCheck(
+ Object* receiver,
+ LookupResult* result,
+ String* name,
+ PropertyAttributes* attributes) {
if (result->IsValid()) {
switch (result->type()) {
case CALLBACKS: {
@@ -226,6 +230,7 @@
if (obj->IsAccessorInfo()) {
AccessorInfo* info = AccessorInfo::cast(obj);
if (info->all_can_read()) {
+ *attributes = result->GetAttributes();
return GetPropertyWithCallback(receiver,
result->GetCallbackObject(),
name,
@@ -241,7 +246,10 @@
LookupResult r;
result->holder()->LookupRealNamedPropertyInPrototypes(name, &r);
if (r.IsValid()) {
- return GetPropertyWithFailedAccessCheck(receiver, &r, name);
+ return GetPropertyWithFailedAccessCheck(receiver,
+ &r,
+ name,
+ attributes);
}
break;
}
@@ -251,9 +259,11 @@
LookupResult r;
result->holder()->LookupRealNamedProperty(name, &r);
if (r.IsValid()) {
- return GetPropertyWithFailedAccessCheck(receiver, &r, name);
+ return GetPropertyWithFailedAccessCheck(receiver,
+ &r,
+ name,
+ attributes);
}
- break;
}
default: {
break;
@@ -261,6 +271,8 @@
}
}
+ // No accessible property found.
+ *attributes = ABSENT;
Top::ReportFailedAccessCheck(this, v8::ACCESS_GET);
return Heap::undefined_value();
}
@@ -402,7 +414,8 @@
if (!Top::MayNamedAccess(checked, name, v8::ACCESS_GET)) {
return checked->GetPropertyWithFailedAccessCheck(receiver,
result,
- name);
+ name,
+ attributes);
}
}
// Stop traversing the chain once we reach the last object in the
« no previous file with comments | « src/objects.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698