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

Unified Diff: src/prototype.h

Issue 1492863002: [proxies] Make Object.prototype.isPrototypeOf work with proxies. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address 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
« no previous file with comments | « src/objects-inl.h ('k') | src/runtime/runtime-debug.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/prototype.h
diff --git a/src/prototype.h b/src/prototype.h
index 072774985357110c23c01131e7e7b0a33fba39f4..2be43e4fbdc9d0794e8670938f709d77652d0387 100644
--- a/src/prototype.h
+++ b/src/prototype.h
@@ -106,6 +106,20 @@ class PrototypeIterator {
}
}
+ // Returns false iff a call to JSProxy::GetPrototype throws.
+ // TODO(neis): This should probably replace Advance().
+ bool AdvanceFollowingProxies() {
+ DCHECK(!(handle_.is_null() && object_->IsJSProxy()));
+ if (!handle_.is_null() && handle_->IsJSProxy()) {
+ did_jump_to_prototype_chain_ = true;
+ MaybeHandle<Object> proto =
+ JSProxy::GetPrototype(Handle<JSProxy>::cast(handle_));
+ return proto.ToHandle(&handle_);
+ }
+ AdvanceIgnoringProxies();
+ return true;
+ }
+
bool IsAtEnd(WhereToEnd where_to_end = END_AT_NULL) const {
if (handle_.is_null()) {
return object_->IsNull() ||
« no previous file with comments | « src/objects-inl.h ('k') | src/runtime/runtime-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698