| 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 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 * `null`. | 448 * `null`. |
| 449 */ | 449 */ |
| 450 List<ConstructorElement> _constructors; | 450 List<ConstructorElement> _constructors; |
| 451 | 451 |
| 452 /** | 452 /** |
| 453 * A list containing all of the methods contained in this class. | 453 * A list containing all of the methods contained in this class. |
| 454 */ | 454 */ |
| 455 List<MethodElement> _methods; | 455 List<MethodElement> _methods; |
| 456 | 456 |
| 457 /** | 457 /** |
| 458 * A flag indicating whether the types associated with the instance methods of | |
| 459 * this class have been inferred. | |
| 460 */ | |
| 461 bool _hasInferredInstanceMethods = false; | |
| 462 | |
| 463 /** | |
| 464 * A flag indicating whether the types associated with the instance members of | 458 * A flag indicating whether the types associated with the instance members of |
| 465 * this class have been inferred. | 459 * this class have been inferred. |
| 466 */ | 460 */ |
| 467 bool _hasBeenInferred = false; | 461 bool _hasBeenInferred = false; |
| 468 | 462 |
| 469 /** | 463 /** |
| 470 * The version of this element. The version is changed when the element is | 464 * The version of this element. The version is changed when the element is |
| 471 * incrementally updated, so that its lists of constructors, accessors and | 465 * incrementally updated, so that its lists of constructors, accessors and |
| 472 * methods might be different. | 466 * methods might be different. |
| 473 */ | 467 */ |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 650 return context.analysisOptions.strongMode; | 644 return context.analysisOptions.strongMode; |
| 651 } | 645 } |
| 652 return _hasBeenInferred; | 646 return _hasBeenInferred; |
| 653 } | 647 } |
| 654 | 648 |
| 655 void set hasBeenInferred(bool hasBeenInferred) { | 649 void set hasBeenInferred(bool hasBeenInferred) { |
| 656 _assertNotResynthesized(_unlinkedClass); | 650 _assertNotResynthesized(_unlinkedClass); |
| 657 _hasBeenInferred = hasBeenInferred; | 651 _hasBeenInferred = hasBeenInferred; |
| 658 } | 652 } |
| 659 | 653 |
| 660 bool get hasInferredInstanceMethods { | |
| 661 if (_unlinkedClass != null) { | |
| 662 return context.analysisOptions.strongMode; | |
| 663 } | |
| 664 return _hasInferredInstanceMethods; | |
| 665 } | |
| 666 | |
| 667 void set hasInferredInstanceMethods(bool done) { | |
| 668 _assertNotResynthesized(_unlinkedClass); | |
| 669 _hasInferredInstanceMethods = done; | |
| 670 } | |
| 671 | |
| 672 @override | 654 @override |
| 673 bool get hasNonFinalField { | 655 bool get hasNonFinalField { |
| 674 List<ClassElement> classesToVisit = new List<ClassElement>(); | 656 List<ClassElement> classesToVisit = new List<ClassElement>(); |
| 675 HashSet<ClassElement> visitedClasses = new HashSet<ClassElement>(); | 657 HashSet<ClassElement> visitedClasses = new HashSet<ClassElement>(); |
| 676 classesToVisit.add(this); | 658 classesToVisit.add(this); |
| 677 while (!classesToVisit.isEmpty) { | 659 while (!classesToVisit.isEmpty) { |
| 678 ClassElement currentElement = classesToVisit.removeAt(0); | 660 ClassElement currentElement = classesToVisit.removeAt(0); |
| 679 if (visitedClasses.add(currentElement)) { | 661 if (visitedClasses.add(currentElement)) { |
| 680 // check fields | 662 // check fields |
| 681 for (FieldElement field in currentElement.fields) { | 663 for (FieldElement field in currentElement.fields) { |
| (...skipping 8216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8898 | 8880 |
| 8899 @override | 8881 @override |
| 8900 void visitElement(Element element) { | 8882 void visitElement(Element element) { |
| 8901 int offset = element.nameOffset; | 8883 int offset = element.nameOffset; |
| 8902 if (offset != -1) { | 8884 if (offset != -1) { |
| 8903 map[offset] = element; | 8885 map[offset] = element; |
| 8904 } | 8886 } |
| 8905 super.visitElement(element); | 8887 super.visitElement(element); |
| 8906 } | 8888 } |
| 8907 } | 8889 } |
| OLD | NEW |