| 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 'ast.dart'; | 10 import 'ast.dart'; |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 | 178 |
| 179 @override | 179 @override |
| 180 visitConstructorDeclaration(ConstructorDeclaration node) { | 180 visitConstructorDeclaration(ConstructorDeclaration node) { |
| 181 _hasConstructor = true; | 181 _hasConstructor = true; |
| 182 SimpleIdentifier constructorName = node.name; | 182 SimpleIdentifier constructorName = node.name; |
| 183 ConstructorElementImpl element = constructorName == null ? | 183 ConstructorElementImpl element = constructorName == null ? |
| 184 _enclosingClass.unnamedConstructor : | 184 _enclosingClass.unnamedConstructor : |
| 185 _enclosingClass.getNamedConstructor(constructorName.name); | 185 _enclosingClass.getNamedConstructor(constructorName.name); |
| 186 _processElement(element); | 186 _processElement(element); |
| 187 _assertCompatibleParameters(node.parameters, element.parameters); | 187 _assertCompatibleParameters(node.parameters, element.parameters); |
| 188 // TODO(scheglov) debug null Location |
| 189 if (element != null) { |
| 190 if (element.context == null || element.source == null) { |
| 191 logger.log('Bad constructor element $element for $node in ${node.parent}
'); |
| 192 } |
| 193 } |
| 188 // matches, update the existing element | 194 // matches, update the existing element |
| 189 ExecutableElement newElement = node.element; | 195 ExecutableElement newElement = node.element; |
| 190 node.element = element; | 196 node.element = element; |
| 191 _setLocalElements(element, newElement); | 197 _setLocalElements(element, newElement); |
| 192 } | 198 } |
| 193 | 199 |
| 194 @override | 200 @override |
| 195 visitEnumConstantDeclaration(EnumConstantDeclaration node) { | 201 visitEnumConstantDeclaration(EnumConstantDeclaration node) { |
| 196 String name = node.name.name; | 202 String name = node.name.name; |
| 197 FieldElement element = _findElement(_enclosingClass.fields, name); | 203 FieldElement element = _findElement(_enclosingClass.fields, name); |
| (...skipping 1515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1713 String toString() => name; | 1719 String toString() => name; |
| 1714 } | 1720 } |
| 1715 | 1721 |
| 1716 | 1722 |
| 1717 class _TokenPair { | 1723 class _TokenPair { |
| 1718 final _TokenDifferenceKind kind; | 1724 final _TokenDifferenceKind kind; |
| 1719 final Token oldToken; | 1725 final Token oldToken; |
| 1720 final Token newToken; | 1726 final Token newToken; |
| 1721 _TokenPair(this.kind, this.oldToken, this.newToken); | 1727 _TokenPair(this.kind, this.oldToken, this.newToken); |
| 1722 } | 1728 } |
| OLD | NEW |