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

Unified Diff: src/prototype.h

Issue 1516843002: [proxy] fixing harmony/proxy.js tests and improving error messages + some drive-by fixes (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: WIP fix protoype walks with access checks 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/prototype.h
diff --git a/src/prototype.h b/src/prototype.h
index 2be43e4fbdc9d0794e8670938f709d77652d0387..87c3aeed8f40c70e42a9d72e9945f8363b5d0367 100644
--- a/src/prototype.h
+++ b/src/prototype.h
@@ -63,6 +63,22 @@ class PrototypeIterator {
~PrototypeIterator() {}
+ const bool HasAccess() {
+ Handle<JSObject> current;
+ if (handle_.is_null()) {
+ if (!object_->IsJSObject()) return true;
+ current = Handle<JSObject>(JSObject::cast(object_));
+ } else {
+ if (!handle_->IsJSObject()) return true;
+ current = Handle<JSObject>::cast(handle_);
+ }
+ if (current->IsJSGlobalProxy() || current->IsJSGlobalObject() ||
+ current->IsAccessCheckNeeded()) {
+ return isolate_->MayAccess(handle(isolate_->context()), current);
+ }
+ return true;
+ }
+
template <typename T = Object>
T* GetCurrent() const {
DCHECK(handle_.is_null());

Powered by Google App Engine
This is Rietveld 408576698