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

Side by Side Diff: frog/leg/ssa/closure.dart

Issue 9502002: Add FunctionDeclaration node. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 9 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 class ClosureFieldElement extends Element { 5 class ClosureFieldElement extends Element {
6 ClosureFieldElement(SourceString name, ClassElement enclosing) 6 ClosureFieldElement(SourceString name, ClassElement enclosing)
7 : super(name, ElementKind.FIELD, enclosing); 7 : super(name, ElementKind.FIELD, enclosing);
8 8
9 bool isInstanceMember() => true; 9 bool isInstanceMember() => true;
10 bool isAssignable() => false; 10 bool isAssignable() => false;
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 savedClosureData.freeVariableMapping.getKeys(); 389 savedClosureData.freeVariableMapping.getKeys();
390 assert(freeVariables.isEmpty() || savedInsideClosure); 390 assert(freeVariables.isEmpty() || savedInsideClosure);
391 for (Element freeElement in freeVariables) { 391 for (Element freeElement in freeVariables) {
392 assert(capturedVariableMapping[freeElement] == null || 392 assert(capturedVariableMapping[freeElement] == null ||
393 capturedVariableMapping[freeElement] == freeElement); 393 capturedVariableMapping[freeElement] == freeElement);
394 capturedVariableMapping[freeElement] = freeElement; 394 capturedVariableMapping[freeElement] = freeElement;
395 useLocal(freeElement); 395 useLocal(freeElement);
396 } 396 }
397 } 397 }
398 398
399 visitFunctionDeclaration(FunctionDeclaration node) {
400 node.visitChildren(this);
401 declareLocal(elements[node]);
402 }
403
399 visitTryStatement(TryStatement node) { 404 visitTryStatement(TryStatement node) {
400 // TODO(ngeoffray): implement finer grain state. 405 // TODO(ngeoffray): implement finer grain state.
401 inTryCatchOrFinally = true; 406 inTryCatchOrFinally = true;
402 node.visitChildren(this); 407 node.visitChildren(this);
403 inTryCatchOrFinally = false; 408 inTryCatchOrFinally = false;
404 } 409 }
405 } 410 }
OLDNEW
« no previous file with comments | « frog/leg/ssa/builder.dart ('k') | frog/leg/tree/nodes.dart » ('j') | frog/leg/typechecker.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698