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

Unified Diff: src/contexts.cc

Issue 1648263002: [debugger] correctly find function context. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: addressed comments Created 4 years, 11 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/contexts.h ('k') | src/debug/debug-scopes.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/contexts.cc
diff --git a/src/contexts.cc b/src/contexts.cc
index dc4c0bd2c6f659775d734db0f6187eb80ebf2c16..7549d205182731b525d69674db7bed8e0e3cdd31 100644
--- a/src/contexts.cc
+++ b/src/contexts.cc
@@ -79,6 +79,15 @@ Context* Context::declaration_context() {
return current;
}
+Context* Context::closure_context() {
+ Context* current = this;
+ while (!current->IsFunctionContext() && !current->IsScriptContext() &&
+ !current->IsNativeContext()) {
+ current = current->previous();
+ DCHECK(current->closure() == closure());
+ }
+ return current;
+}
JSObject* Context::extension_object() {
DCHECK(IsNativeContext() || IsFunctionContext() || IsBlockContext());
« no previous file with comments | « src/contexts.h ('k') | src/debug/debug-scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698