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

Side by Side Diff: lib/compiler/implementation/closure.dart

Issue 11273121: Support closures inside initializers. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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 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 library closureToClassMapper; 5 library closureToClassMapper;
6 6
7 import "elements/elements.dart"; 7 import "elements/elements.dart";
8 import "dart2jslib.dart"; 8 import "dart2jslib.dart";
9 import "tree/tree.dart"; 9 import "tree/tree.dart";
10 import "util/util.dart"; 10 import "util/util.dart";
(...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 return node.name.accept(this); 606 return node.name.accept(this);
607 } 607 }
608 608
609 visitInvokable(element, node, () { 609 visitInvokable(element, node, () {
610 // TODO(ahe): This is problematic. The backend should not repeat 610 // TODO(ahe): This is problematic. The backend should not repeat
611 // the work of the resolver. It is the resolver's job to create 611 // the work of the resolver. It is the resolver's job to create
612 // parameters, etc. Other phases should only visit statements. 612 // parameters, etc. Other phases should only visit statements.
613 // TODO(floitsch): we avoid visiting the initializers on purpose so that 613 // TODO(floitsch): we avoid visiting the initializers on purpose so that
614 // we get an error-message later in the builder. 614 // we get an error-message later in the builder.
615 if (node.parameters != null) node.parameters.accept(this); 615 if (node.parameters != null) node.parameters.accept(this);
616 if (node.initializers != null) node.initializers.accept(this);
616 if (node.body != null) node.body.accept(this); 617 if (node.body != null) node.body.accept(this);
617 }); 618 });
618 } 619 }
619 620
620 visitFunctionDeclaration(FunctionDeclaration node) { 621 visitFunctionDeclaration(FunctionDeclaration node) {
621 node.visitChildren(this); 622 node.visitChildren(this);
622 declareLocal(elements[node]); 623 declareLocal(elements[node]);
623 } 624 }
624 625
625 visitTryStatement(TryStatement node) { 626 visitTryStatement(TryStatement node) {
626 // TODO(ngeoffray): implement finer grain state. 627 // TODO(ngeoffray): implement finer grain state.
627 bool oldInTryStatement = inTryStatement; 628 bool oldInTryStatement = inTryStatement;
628 inTryStatement = true; 629 inTryStatement = true;
629 node.visitChildren(this); 630 node.visitChildren(this);
630 inTryStatement = oldInTryStatement; 631 inTryStatement = oldInTryStatement;
631 } 632 }
632 } 633 }
OLDNEW
« no previous file with comments | « no previous file | lib/compiler/implementation/ssa/builder.dart » ('j') | lib/compiler/implementation/ssa/builder.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698