| 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 analyzer.src.dart.element.element; | 5 library analyzer.src.dart.element.element; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 import 'dart:math' show min; | 8 import 'dart:math' show min; |
| 9 | 9 |
| 10 import 'package:analyzer/dart/ast/ast.dart'; | 10 import 'package:analyzer/dart/ast/ast.dart'; |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 return null; | 379 return null; |
| 380 } | 380 } |
| 381 | 381 |
| 382 /** | 382 /** |
| 383 * Return the [AbstractClassElementImpl] of the given [classElement]. May | 383 * Return the [AbstractClassElementImpl] of the given [classElement]. May |
| 384 * throw an exception if the [AbstractClassElementImpl] cannot be provided | 384 * throw an exception if the [AbstractClassElementImpl] cannot be provided |
| 385 * (should not happen though). | 385 * (should not happen though). |
| 386 */ | 386 */ |
| 387 static AbstractClassElementImpl getImpl(ClassElement classElement) { | 387 static AbstractClassElementImpl getImpl(ClassElement classElement) { |
| 388 if (classElement is ClassElementHandle) { | 388 if (classElement is ClassElementHandle) { |
| 389 classElement.ensureActualElementComplete(); | |
| 390 return getImpl(classElement.actualElement); | 389 return getImpl(classElement.actualElement); |
| 391 } | 390 } |
| 392 return classElement as AbstractClassElementImpl; | 391 return classElement as AbstractClassElementImpl; |
| 393 } | 392 } |
| 394 } | 393 } |
| 395 | 394 |
| 396 /** | 395 /** |
| 397 * For AST nodes that could be in both the getter and setter contexts | 396 * For AST nodes that could be in both the getter and setter contexts |
| 398 * ([IndexExpression]s and [SimpleIdentifier]s), the additional resolved | 397 * ([IndexExpression]s and [SimpleIdentifier]s), the additional resolved |
| 399 * elements are stored in the AST node, in an [AuxiliaryElements]. Because | 398 * elements are stored in the AST node, in an [AuxiliaryElements]. Because |
| (...skipping 7793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8193 | 8192 |
| 8194 @override | 8193 @override |
| 8195 void visitElement(Element element) { | 8194 void visitElement(Element element) { |
| 8196 int offset = element.nameOffset; | 8195 int offset = element.nameOffset; |
| 8197 if (offset != -1) { | 8196 if (offset != -1) { |
| 8198 map[offset] = element; | 8197 map[offset] = element; |
| 8199 } | 8198 } |
| 8200 super.visitElement(element); | 8199 super.visitElement(element); |
| 8201 } | 8200 } |
| 8202 } | 8201 } |
| OLD | NEW |