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 2727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2738 void set documentationComment(String doc) { | 2738 void set documentationComment(String doc) { |
2739 assert(!isResynthesized); | 2739 assert(!isResynthesized); |
2740 _docComment = doc?.replaceAll('\r\n', '\n'); | 2740 _docComment = doc?.replaceAll('\r\n', '\n'); |
2741 } | 2741 } |
2742 | 2742 |
2743 @override | 2743 @override |
2744 Element get enclosingElement => _enclosingElement; | 2744 Element get enclosingElement => _enclosingElement; |
2745 | 2745 |
2746 /** | 2746 /** |
2747 * Set the enclosing element of this element to the given [element]. | 2747 * Set the enclosing element of this element to the given [element]. |
2748 * | |
2749 * Throws [FrozenHashCodeException] if the hashCode can't be changed. | |
2750 */ | 2748 */ |
2751 void set enclosingElement(Element element) { | 2749 void set enclosingElement(Element element) { |
2752 _enclosingElement = element as ElementImpl; | 2750 _enclosingElement = element as ElementImpl; |
2753 } | 2751 } |
2754 | 2752 |
2755 /** | 2753 /** |
2756 * Return the enclosing unit element (which might be the same as `this`), or | 2754 * Return the enclosing unit element (which might be the same as `this`), or |
2757 * `null` if this element is not contained in any compilation unit. | 2755 * `null` if this element is not contained in any compilation unit. |
2758 */ | 2756 */ |
2759 CompilationUnitElementImpl get enclosingUnit { | 2757 CompilationUnitElementImpl get enclosingUnit { |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2888 void set metadata(List<ElementAnnotation> metadata) { | 2886 void set metadata(List<ElementAnnotation> metadata) { |
2889 assert(!isResynthesized); | 2887 assert(!isResynthesized); |
2890 _metadata = metadata; | 2888 _metadata = metadata; |
2891 } | 2889 } |
2892 | 2890 |
2893 @override | 2891 @override |
2894 String get name => _name; | 2892 String get name => _name; |
2895 | 2893 |
2896 /** | 2894 /** |
2897 * Changes the name of this element. | 2895 * Changes the name of this element. |
2898 * | |
2899 * Throws [FrozenHashCodeException] if the hashCode can't be changed. | |
2900 */ | 2896 */ |
2901 void set name(String name) { | 2897 void set name(String name) { |
2902 this._name = name; | 2898 this._name = name; |
2903 } | 2899 } |
2904 | 2900 |
2905 @override | 2901 @override |
2906 int get nameLength => displayName != null ? displayName.length : 0; | 2902 int get nameLength => displayName != null ? displayName.length : 0; |
2907 | 2903 |
2908 @override | 2904 @override |
2909 int get nameOffset => _nameOffset; | 2905 int get nameOffset => _nameOffset; |
2910 | 2906 |
2911 /** | 2907 /** |
2912 * Sets the offset of the name of this element in the file that contains the | 2908 * Sets the offset of the name of this element in the file that contains the |
2913 * declaration of this element. | 2909 * declaration of this element. |
2914 * | |
2915 * Throws [FrozenHashCodeException] if the hashCode can't be changed. | |
2916 */ | 2910 */ |
2917 void set nameOffset(int offset) { | 2911 void set nameOffset(int offset) { |
2918 _nameOffset = offset; | 2912 _nameOffset = offset; |
2919 } | 2913 } |
2920 | 2914 |
2921 @override | 2915 @override |
2922 Source get source { | 2916 Source get source { |
2923 if (_enclosingElement == null) { | 2917 if (_enclosingElement == null) { |
2924 return null; | 2918 return null; |
2925 } | 2919 } |
(...skipping 5952 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8878 | 8872 |
8879 @override | 8873 @override |
8880 DartObject computeConstantValue() => null; | 8874 DartObject computeConstantValue() => null; |
8881 | 8875 |
8882 @override | 8876 @override |
8883 void visitChildren(ElementVisitor visitor) { | 8877 void visitChildren(ElementVisitor visitor) { |
8884 super.visitChildren(visitor); | 8878 super.visitChildren(visitor); |
8885 _initializer?.accept(visitor); | 8879 _initializer?.accept(visitor); |
8886 } | 8880 } |
8887 } | 8881 } |
OLD | NEW |