| 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 import 'dart:math' as math; | 8 import 'dart:math' as math; |
| 9 | 9 |
| 10 import 'package:analyzer/src/generated/constant.dart'; | 10 import 'package:analyzer/src/generated/constant.dart'; |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 visitConstructorDeclaration(ConstructorDeclaration node) { | 181 visitConstructorDeclaration(ConstructorDeclaration node) { |
| 182 _hasConstructor = true; | 182 _hasConstructor = true; |
| 183 SimpleIdentifier constructorName = node.name; | 183 SimpleIdentifier constructorName = node.name; |
| 184 ConstructorElementImpl element = constructorName == null | 184 ConstructorElementImpl element = constructorName == null |
| 185 ? _enclosingClass.unnamedConstructor | 185 ? _enclosingClass.unnamedConstructor |
| 186 : _enclosingClass.getNamedConstructor(constructorName.name); | 186 : _enclosingClass.getNamedConstructor(constructorName.name); |
| 187 _processElement(element); | 187 _processElement(element); |
| 188 _assertEquals(node.constKeyword != null, element.isConst); | 188 _assertEquals(node.constKeyword != null, element.isConst); |
| 189 _assertEquals(node.factoryKeyword != null, element.isFactory); | 189 _assertEquals(node.factoryKeyword != null, element.isFactory); |
| 190 _assertCompatibleParameters(node.parameters, element.parameters); | 190 _assertCompatibleParameters(node.parameters, element.parameters); |
| 191 // TODO(scheglov) debug null Location | |
| 192 if (element != null) { | |
| 193 if (element.context == null || element.source == null) { | |
| 194 logger.log( | |
| 195 'Bad constructor element $element for $node in ${node.parent}'); | |
| 196 } | |
| 197 } | |
| 198 // matches, update the existing element | 191 // matches, update the existing element |
| 199 ExecutableElement newElement = node.element; | 192 ExecutableElement newElement = node.element; |
| 200 node.element = element; | 193 node.element = element; |
| 201 _setLocalElements(element, newElement); | 194 _setLocalElements(element, newElement); |
| 202 } | 195 } |
| 203 | 196 |
| 204 @override | 197 @override |
| 205 visitEnumConstantDeclaration(EnumConstantDeclaration node) { | 198 visitEnumConstantDeclaration(EnumConstantDeclaration node) { |
| 206 String name = node.name.name; | 199 String name = node.name.name; |
| 207 FieldElement element = _findElement(_enclosingClass.fields, name); | 200 FieldElement element = _findElement(_enclosingClass.fields, name); |
| (...skipping 1636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1844 @override | 1837 @override |
| 1845 String toString() => name; | 1838 String toString() => name; |
| 1846 } | 1839 } |
| 1847 | 1840 |
| 1848 class _TokenPair { | 1841 class _TokenPair { |
| 1849 final _TokenDifferenceKind kind; | 1842 final _TokenDifferenceKind kind; |
| 1850 final Token oldToken; | 1843 final Token oldToken; |
| 1851 final Token newToken; | 1844 final Token newToken; |
| 1852 _TokenPair(this.kind, this.oldToken, this.newToken); | 1845 _TokenPair(this.kind, this.oldToken, this.newToken); |
| 1853 } | 1846 } |
| OLD | NEW |