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

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

Issue 732543002: Implement 'setVariableValue' for debugger block scopes. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Patch for landing Created 6 years, 1 month 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 | « no previous file | test/mjsunit/harmony/debug-evaluate-blockscopes.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-debug.cc
diff --git a/src/runtime/runtime-debug.cc b/src/runtime/runtime-debug.cc
index 28657ee72bcbd3677cdf79e5947e121a5543f0c0..d576dc73a9f41a0f5adcd93874ad2ed5edfa6c5d 100644
--- a/src/runtime/runtime-debug.cc
+++ b/src/runtime/runtime-debug.cc
@@ -986,6 +986,17 @@ static bool SetClosureVariableValue(Isolate* isolate, Handle<Context> context,
}
+static bool SetBlockContextVariableValue(Handle<Context> block_context,
+ Handle<String> variable_name,
+ Handle<Object> new_value) {
+ DCHECK(block_context->IsBlockContext());
+ Handle<ScopeInfo> scope_info(ScopeInfo::cast(block_context->extension()));
+
+ return SetContextLocalValue(block_context->GetIsolate(), scope_info,
+ block_context, variable_name, new_value);
+}
+
+
// Create a plain JSObject which materializes the scope for the specified
// catch context.
MUST_USE_RESULT static MaybeHandle<JSObject> MaterializeCatchScope(
@@ -1304,8 +1315,8 @@ class ScopeIterator {
return SetClosureVariableValue(isolate_, CurrentContext(),
variable_name, new_value);
case ScopeIterator::ScopeTypeBlock:
- // TODO(2399): should we implement it?
- break;
+ return SetBlockContextVariableValue(CurrentContext(), variable_name,
+ new_value);
case ScopeIterator::ScopeTypeModule:
// TODO(2399): should we implement it?
break;
« no previous file with comments | « no previous file | test/mjsunit/harmony/debug-evaluate-blockscopes.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698