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

Unified Diff: src/debug/debug-scopes.cc

Issue 2228393002: Allow access to scopes of suspended generator objects (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Remove stale TODO comment Created 4 years, 4 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/debug/debug-scopes.h ('k') | src/debug/mirrors.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug/debug-scopes.cc
diff --git a/src/debug/debug-scopes.cc b/src/debug/debug-scopes.cc
index ce9cac2046cd2c7879959c7b9831ed13763773ed..5e3a1574130be13914db81ba1a2e60c9ed4e5d4f 100644
--- a/src/debug/debug-scopes.cc
+++ b/src/debug/debug-scopes.cc
@@ -125,6 +125,19 @@ ScopeIterator::ScopeIterator(Isolate* isolate, Handle<JSFunction> function)
UnwrapEvaluationContext();
}
+ScopeIterator::ScopeIterator(Isolate* isolate,
+ Handle<JSGeneratorObject> generator)
+ : isolate_(isolate),
+ frame_inspector_(NULL),
+ context_(generator->context()),
+ seen_script_scope_(false),
+ failed_(false) {
+ if (!generator->function()->shared()->IsSubjectToDebugging()) {
+ context_ = Handle<Context>();
+ }
+ UnwrapEvaluationContext();
+}
+
void ScopeIterator::UnwrapEvaluationContext() {
while (true) {
if (context_.is_null()) return;
@@ -623,6 +636,7 @@ bool ScopeIterator::SetParameterValue(Handle<ScopeInfo> scope_info,
bool ScopeIterator::SetStackVariableValue(Handle<ScopeInfo> scope_info,
Handle<String> variable_name,
Handle<Object> new_value) {
+ if (frame_inspector_ == nullptr) return false;
JavaScriptFrame* frame = GetFrame();
// Setting stack locals of optimized frames is not supported.
if (frame->is_optimized()) return false;
« no previous file with comments | « src/debug/debug-scopes.h ('k') | src/debug/mirrors.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698