Commit edacd800 authored by Yuki Shiino's avatar Yuki Shiino Committed by Commit Bot

Invoke access-check-interceptor in GetOwnPropertyDescriptor

Object::Get, Set, etc. properly invoke an interceptor
registered via SetAccessCheckCallbackAndHandler, however,
Object::GetOwnPropertyDescriptor does not invoke
an interceptor.

This patch supports access-check-interceptor for
descriptors.

Change-Id: Ie2b2f2456be95c6eef8c2cdfee2bdd651c011fa3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1720969Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
Commit-Queue: Yuki Shiino <yukishiino@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62978}
parent 51afbd1a
......@@ -1509,20 +1509,27 @@ namespace {
Maybe<bool> GetPropertyDescriptorWithInterceptor(LookupIterator* it,
PropertyDescriptor* desc) {
Handle<InterceptorInfo> interceptor;
if (it->state() == LookupIterator::ACCESS_CHECK) {
if (it->HasAccess()) {
it->Next();
} else if (!JSObject::AllCanRead(it) ||
it->state() != LookupIterator::INTERCEPTOR) {
it->Restart();
return Just(false);
} else {
interceptor = it->GetInterceptorForFailedAccessCheck();
if (interceptor.is_null() &&
(!JSObject::AllCanRead(it) ||
it->state() != LookupIterator::INTERCEPTOR)) {
it->Restart();
return Just(false);
}
}
}
if (it->state() != LookupIterator::INTERCEPTOR) return Just(false);
if (it->state() == LookupIterator::INTERCEPTOR) {
interceptor = it->GetInterceptor();
}
if (interceptor.is_null()) return Just(false);
Isolate* isolate = it->isolate();
Handle<InterceptorInfo> interceptor = it->GetInterceptor();
if (interceptor->descriptor().IsUndefined(isolate)) return Just(false);
Handle<Object> result;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment