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

Unified Diff: src/prototype.h

Issue 1748923003: [proxies] use [[GetPrototypeOf]] trap in for-in (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: merge with master Created 4 years, 9 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 | « src/objects-inl.h ('k') | src/runtime/runtime-forin.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 c5e954554ca88cf6f76f2a06e03be2710b52a383..e09ff0ff0cd28edc6d0c5d86c8d13c4e21fc708e 100644
--- a/src/prototype.h
+++ b/src/prototype.h
@@ -125,7 +125,7 @@ class PrototypeIterator {
// Returns false iff a call to JSProxy::GetPrototype throws.
// TODO(neis): This should probably replace Advance().
- bool AdvanceFollowingProxies() {
+ MUST_USE_RESULT bool AdvanceFollowingProxies() {
DCHECK(!(handle_.is_null() && object_->IsJSProxy()));
if (!HasAccess()) {
// Abort the lookup if we do not have access to the current object.
@@ -133,10 +133,15 @@ class PrototypeIterator {
is_at_end_ = true;
return true;
}
+ return AdvanceFollowingProxiesIgnoringAccessChecks();
+ }
+
+ MUST_USE_RESULT bool AdvanceFollowingProxiesIgnoringAccessChecks() {
if (handle_.is_null() || !handle_->IsJSProxy()) {
AdvanceIgnoringProxies();
return true;
}
+
// Due to possible __proto__ recursion limit the number of Proxies
// we visit to an arbitrarily chosen large number.
seen_proxies_++;
« no previous file with comments | « src/objects-inl.h ('k') | src/runtime/runtime-forin.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698