Index: src/debug/debug-scopes.cc |
diff --git a/src/debug/debug-scopes.cc b/src/debug/debug-scopes.cc |
index 047574ae9cf179aa5f37c04422d9cca0aa02c738..c84b788f3f95aa595160702ab992e2dae0b74c8f 100644 |
--- a/src/debug/debug-scopes.cc |
+++ b/src/debug/debug-scopes.cc |
@@ -643,23 +643,25 @@ bool ScopeIterator::SetLocalVariableValue(Handle<String> variable_name, |
bool default_result = false; |
// Parameters. |
- for (int i = 0; i < scope_info->ParameterCount(); ++i) { |
- HandleScope scope(isolate_); |
- if (String::Equals(handle(scope_info->ParameterName(i)), variable_name)) { |
- frame->SetParameterValue(i, *new_value); |
- // Argument might be shadowed in heap context, don't stop here. |
- default_result = true; |
- } |
- } |
+ FOR_WITH_HANDLE_SCOPE( |
+ isolate_, int, i = 0, i, i < scope_info->ParameterCount(), ++i, { |
+ if (String::Equals(handle(scope_info->ParameterName(i)), |
+ variable_name)) { |
+ frame->SetParameterValue(i, *new_value); |
+ // Argument might be shadowed in heap context, don't stop here. |
+ default_result = true; |
+ } |
+ }); |
// Stack locals. |
- for (int i = 0; i < scope_info->StackLocalCount(); ++i) { |
- HandleScope scope(isolate_); |
- if (String::Equals(handle(scope_info->StackLocalName(i)), variable_name)) { |
- frame->SetExpression(scope_info->StackLocalIndex(i), *new_value); |
- return true; |
- } |
- } |
+ FOR_WITH_HANDLE_SCOPE( |
+ isolate_, int, i = 0, i, i < scope_info->StackLocalCount(), ++i, { |
+ if (String::Equals(handle(scope_info->StackLocalName(i)), |
+ variable_name)) { |
+ frame->SetExpression(scope_info->StackLocalIndex(i), *new_value); |
+ return true; |
+ } |
+ }); |
if (scope_info->HasContext()) { |
// Context locals. |
@@ -699,13 +701,15 @@ bool ScopeIterator::SetBlockVariableValue(Handle<String> variable_name, |
Handle<ScopeInfo> scope_info = CurrentScopeInfo(); |
JavaScriptFrame* frame = GetFrame(); |
- for (int i = 0; i < scope_info->StackLocalCount(); ++i) { |
- HandleScope scope(isolate_); |
- if (String::Equals(handle(scope_info->StackLocalName(i)), variable_name)) { |
- frame->SetExpression(scope_info->StackLocalIndex(i), *new_value); |
- return true; |
- } |
- } |
+ FOR_WITH_HANDLE_SCOPE( |
+ isolate_, int, i = 0, i, i < scope_info->StackLocalCount(), ++i, { |
+ HandleScope scope(isolate_); |
+ if (String::Equals(handle(scope_info->StackLocalName(i)), |
+ variable_name)) { |
+ frame->SetExpression(scope_info->StackLocalIndex(i), *new_value); |
+ return true; |
+ } |
+ }); |
if (HasContext()) { |
Handle<Context> context = CurrentContext(); |