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

Unified Diff: src/objects.cc

Issue 2707263002: [api] Fix DescriptorInterceptor with access check. (Closed)
Patch Set: Check access if needed. Created 3 years, 10 months 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 | « no previous file | test/cctest/test-api-interceptors.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index bdaffa42bb68d017477d78fb1f2ae6a843b68b23..d958f03a58949b0bd8e57be78b709d5adc5b7dfa 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -6893,7 +6893,13 @@ namespace {
Maybe<bool> GetPropertyDescriptorWithInterceptor(LookupIterator* it,
PropertyDescriptor* desc) {
- if (it->state() == LookupIterator::INTERCEPTOR) {
+ bool has_access = true;
+ if (it->state() == LookupIterator::ACCESS_CHECK) {
+ has_access = it->HasAccess() || JSObject::AllCanRead(it);
+ it->Next();
+ }
+
+ if (has_access && it->state() == LookupIterator::INTERCEPTOR) {
Isolate* isolate = it->isolate();
Handle<InterceptorInfo> interceptor = it->GetInterceptor();
if (!interceptor->descriptor()->IsUndefined(isolate)) {
@@ -6937,6 +6943,7 @@ Maybe<bool> GetPropertyDescriptorWithInterceptor(LookupIterator* it,
}
}
}
+ it->Restart();
return Just(false);
}
} // namespace
« no previous file with comments | « no previous file | test/cctest/test-api-interceptors.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698