OLD | NEW |
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 Loading... |
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 } |
OLD | NEW |