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

Side by Side Diff: runtime/vm/scopes.cc

Issue 9961012: Fix debugger crashes (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/scopes.h" 5 #include "vm/scopes.h"
6 6
7 #include "vm/ast.h" 7 #include "vm/ast.h"
8 #include "vm/object.h" 8 #include "vm/object.h"
9 9
10 namespace dart { 10 namespace dart {
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 } 199 }
200 return var_desc.raw(); 200 return var_desc.raw();
201 } 201 }
202 202
203 203
204 // Add variables that are declared in this scope to vars, then collect 204 // Add variables that are declared in this scope to vars, then collect
205 // variables of children, followed by siblings. 205 // variables of children, followed by siblings.
206 void LocalScope::CollectLocalVariables(GrowableArray<LocalVariable*>* vars) { 206 void LocalScope::CollectLocalVariables(GrowableArray<LocalVariable*>* vars) {
207 for (int i = 0; i < this->variables_.length(); i++) { 207 for (int i = 0; i < this->variables_.length(); i++) {
208 LocalVariable* var = variables_[i]; 208 LocalVariable* var = variables_[i];
209 if ((var->owner() == this) && Scanner::IsIdent(var->name())) { 209 // TODO(hausner): Remove the is_captured() condition once the debugger
210 // can handle getting values of captured variables.
211 if (!var->is_captured() && (var->owner() == this) &&
212 Scanner::IsIdent(var->name())) {
210 vars->Add(this->variables_[i]); 213 vars->Add(this->variables_[i]);
211 } 214 }
212 } 215 }
213 if (child() != NULL) { 216 if (child() != NULL) {
214 child()->CollectLocalVariables(vars); 217 child()->CollectLocalVariables(vars);
215 } 218 }
216 if (sibling() != NULL) { 219 if (sibling() != NULL) {
217 sibling()->CollectLocalVariables(vars); 220 sibling()->CollectLocalVariables(vars);
218 } 221 }
219 } 222 }
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 } 471 }
469 if (owner()->context_level() == other.owner()->context_level()) { 472 if (owner()->context_level() == other.owner()->context_level()) {
470 return true; 473 return true;
471 } 474 }
472 } 475 }
473 } 476 }
474 return false; 477 return false;
475 } 478 }
476 479
477 } // namespace dart 480 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698