| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 engine.incremental_resolver; | 5 library engine.incremental_resolver; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 | 8 |
| 9 import 'ast.dart'; | 9 import 'ast.dart'; |
| 10 import 'element.dart'; | 10 import 'element.dart'; |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 } | 137 } |
| 138 | 138 |
| 139 @override | 139 @override |
| 140 visitCompilationUnit(CompilationUnit node) { | 140 visitCompilationUnit(CompilationUnit node) { |
| 141 _processElement(_enclosingUnit); | 141 _processElement(_enclosingUnit); |
| 142 super.visitCompilationUnit(node); | 142 super.visitCompilationUnit(node); |
| 143 } | 143 } |
| 144 | 144 |
| 145 @override | 145 @override |
| 146 visitConstructorDeclaration(ConstructorDeclaration node) { | 146 visitConstructorDeclaration(ConstructorDeclaration node) { |
| 147 _hasConstructor = true; |
| 147 ExecutableElement outerExecutable = _enclosingExecutable; | 148 ExecutableElement outerExecutable = _enclosingExecutable; |
| 148 try { | 149 try { |
| 149 SimpleIdentifier constructorName = node.name; | 150 SimpleIdentifier constructorName = node.name; |
| 150 if (constructorName == null) { | 151 if (constructorName == null) { |
| 151 _enclosingExecutable = _enclosingClass.unnamedConstructor; | 152 _enclosingExecutable = _enclosingClass.unnamedConstructor; |
| 152 } else { | 153 } else { |
| 153 _enclosingExecutable = | 154 _enclosingExecutable = |
| 154 _enclosingClass.getNamedConstructor(constructorName.name); | 155 _enclosingClass.getNamedConstructor(constructorName.name); |
| 155 } | 156 } |
| 156 _processElement(_enclosingExecutable); | 157 _processElement(_enclosingExecutable); |
| (...skipping 874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1031 visitElement(Element element) { | 1032 visitElement(Element element) { |
| 1032 _addElement(element); | 1033 _addElement(element); |
| 1033 super.visitElement(element); | 1034 super.visitElement(element); |
| 1034 } | 1035 } |
| 1035 | 1036 |
| 1036 @override | 1037 @override |
| 1037 visitPropertyAccessorElement(PropertyAccessorElement element) { | 1038 visitPropertyAccessorElement(PropertyAccessorElement element) { |
| 1038 if (!element.isSynthetic) { | 1039 if (!element.isSynthetic) { |
| 1039 _addElement(element); | 1040 _addElement(element); |
| 1040 } | 1041 } |
| 1041 // Don't visit children (such as a synthetic setter parameter). | 1042 // Don't visit children (such as synthetic setter parameters). |
| 1042 } | 1043 } |
| 1043 | 1044 |
| 1044 @override | 1045 @override |
| 1045 visitPropertyInducingElement(PropertyInducingElement element) { | 1046 visitPropertyInducingElement(PropertyInducingElement element) { |
| 1046 // TODO(scheglov) should we remove synthetic variable initializer? | |
| 1047 // _addElement(element); | |
| 1048 // element.getter.accept(this); | |
| 1049 // element.setter.accept(this); | |
| 1050 // _addElement(element.getter); | |
| 1051 // _addElement(element.setter); | |
| 1052 } | |
| 1053 | |
| 1054 @override | |
| 1055 visitTopLevelVariableElement(TopLevelVariableElement element) { | |
| 1056 if (!element.isSynthetic) { | 1047 if (!element.isSynthetic) { |
| 1057 _addElement(element); | 1048 _addElement(element); |
| 1058 } | 1049 } |
| 1050 // Don't visit children (such as property accessors). |
| 1059 } | 1051 } |
| 1060 | 1052 |
| 1061 void _addElement(Element element) { | 1053 void _addElement(Element element) { |
| 1062 if (element != null) { | 1054 if (element != null) { |
| 1063 matcher._allElements.add(element); | 1055 matcher._allElements.add(element); |
| 1064 matcher._unmatchedElements.add(element); | 1056 matcher._unmatchedElements.add(element); |
| 1065 } | 1057 } |
| 1066 } | 1058 } |
| 1067 } | 1059 } |
| OLD | NEW |