OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 inferrer_visitor; | 5 library inferrer_visitor; |
6 | 6 |
7 import 'dart:collection' show IterableMixin; | 7 import 'dart:collection' show IterableMixin; |
8 | 8 |
9 import '../common.dart'; | 9 import '../common.dart'; |
10 import '../compiler.dart' show Compiler; | 10 import '../compiler.dart' show Compiler; |
(...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
734 locals.fieldScope.isThisExposed = value; | 734 locals.fieldScope.isThisExposed = value; |
735 } | 735 } |
736 } | 736 } |
737 | 737 |
738 InferrerVisitor(AstElement analyzedElement, this.resolvedAst, this.inferrer, | 738 InferrerVisitor(AstElement analyzedElement, this.resolvedAst, this.inferrer, |
739 this.types, this.compiler, | 739 this.types, this.compiler, |
740 [LocalsHandler<T> handler]) | 740 [LocalsHandler<T> handler]) |
741 : this.analyzedElement = analyzedElement, | 741 : this.analyzedElement = analyzedElement, |
742 this.locals = handler { | 742 this.locals = handler { |
743 if (handler != null) return; | 743 if (handler != null) return; |
744 Node node = analyzedElement.node; | 744 Node node; |
| 745 if (resolvedAst.kind == ResolvedAstKind.PARSED) { |
| 746 node = resolvedAst.node; |
| 747 } |
745 FieldInitializationScope<T> fieldScope = | 748 FieldInitializationScope<T> fieldScope = |
746 analyzedElement.isGenerativeConstructor | 749 analyzedElement.isGenerativeConstructor |
747 ? new FieldInitializationScope<T>(types) | 750 ? new FieldInitializationScope<T>(types) |
748 : null; | 751 : null; |
749 locals = new LocalsHandler<T>(inferrer, types, compiler, node, fieldScope); | 752 locals = new LocalsHandler<T>(inferrer, types, compiler, node, fieldScope); |
750 } | 753 } |
751 | 754 |
752 DiagnosticReporter get reporter => compiler.reporter; | 755 DiagnosticReporter get reporter => compiler.reporter; |
753 | 756 |
754 @override | 757 @override |
(...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1484 return type; | 1487 return type; |
1485 } | 1488 } |
1486 | 1489 |
1487 T visitCascade(Cascade node) { | 1490 T visitCascade(Cascade node) { |
1488 // Ignore the result of the cascade send and return the type of the cascade | 1491 // Ignore the result of the cascade send and return the type of the cascade |
1489 // receiver. | 1492 // receiver. |
1490 visit(node.expression); | 1493 visit(node.expression); |
1491 return cascadeReceiverStack.removeLast(); | 1494 return cascadeReceiverStack.removeLast(); |
1492 } | 1495 } |
1493 } | 1496 } |
OLD | NEW |