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

Side by Side Diff: frog/block_scope.dart

Issue 9270048: Lots of frog cleanup (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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 unified diff | Download patch | Annotate | Revision Log
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 5
6 class BlockScope { 6 class BlockScope {
7 MethodGenerator enclosingMethod; 7 MethodGenerator enclosingMethod;
8 BlockScope parent; 8 BlockScope parent;
9 9
10 // TODO(jimhug): Using a list or tree-based map may improve perf; the list 10 // TODO(jimhug): Using a list or tree-based map may improve perf; the list
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 if (name != jsName) _jsNames.add(jsName); 165 if (name != jsName) _jsNames.add(jsName);
166 return ret; 166 return ret;
167 } 167 }
168 168
169 Value declareParameter(Parameter p) { 169 Value declareParameter(Parameter p) {
170 return create(p.name, p.type, p.definition.span, isParameter:true); 170 return create(p.name, p.type, p.definition.span, isParameter:true);
171 } 171 }
172 172
173 /** Declares a variable in the current scope for this identifier. */ 173 /** Declares a variable in the current scope for this identifier. */
174 Value declare(DeclaredIdentifier id) { 174 Value declare(DeclaredIdentifier id) {
175 var type = enclosingMethod.method.resolveType(id.type, false); 175 var type = enclosingMethod.method.resolveType(id.type, false, true);
176 return create(id.name.name, type, id.span); 176 return create(id.name.name, type, id.span);
177 } 177 }
178 178
179 /** 179 /**
180 * Finds the first lexically enclosing catch block, if any, and returns its 180 * Finds the first lexically enclosing catch block, if any, and returns its
181 * exception variable. 181 * exception variable.
182 */ 182 */
183 String getRethrow() { 183 String getRethrow() {
184 var scope = this; 184 var scope = this;
185 while (scope.rethrow == null && scope.parent != null) { 185 while (scope.rethrow == null && scope.parent != null) {
(...skipping 27 matching lines...) Expand all
213 if (myVar.value !== v) { 213 if (myVar.value !== v) {
214 _vars[key] = myVar.replaceValue(v); 214 _vars[key] = myVar.replaceValue(v);
215 changed = true; 215 changed = true;
216 } 216 }
217 }); 217 });
218 } 218 }
219 219
220 return changed; 220 return changed;
221 } 221 }
222 } 222 }
OLDNEW
« no previous file with comments | « frog/analyze_frame.dart ('k') | frog/element.dart » ('j') | frog/gen.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698