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

Unified Diff: src/objects-inl.h

Issue 1521953002: [proxies] fix access issue when having proxies on the prototype-chain of global objects. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: better comment Created 5 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
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 9622c8cfc1a7c95c5abe26d15e34a99049e63bfa..31a66b1a5cf6cd753f3e853621d3cc7419405bee 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -1187,14 +1187,10 @@ MaybeHandle<Object> Object::GetPrototype(Isolate* isolate,
Handle<Object> receiver) {
// We don't expect access checks to be needed on JSProxy objects.
DCHECK(!receiver->IsAccessCheckNeeded() || receiver->IsJSObject());
- Handle<Context> context(isolate->context());
- if (receiver->IsAccessCheckNeeded() &&
- !isolate->MayAccess(context, Handle<JSObject>::cast(receiver))) {
- return isolate->factory()->null_value();
- }
PrototypeIterator iter(isolate, receiver,
PrototypeIterator::START_AT_RECEIVER);
do {
+ if (!iter.HasAccess()) return isolate->factory()->null_value();
if (!iter.AdvanceFollowingProxies()) return MaybeHandle<Object>();
} while (!iter.IsAtEnd(PrototypeIterator::END_AT_NON_HIDDEN));
return PrototypeIterator::GetCurrent(iter);

Powered by Google App Engine
This is Rietveld 408576698