| 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/element/element.dart'; | 10 import 'package:analyzer/dart/element/element.dart'; |
| (...skipping 2794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2805 ImportElementImpl(int offset) : super(null, offset); | 2805 ImportElementImpl(int offset) : super(null, offset); |
| 2806 | 2806 |
| 2807 /** | 2807 /** |
| 2808 * Set whether this import is for a deferred library. | 2808 * Set whether this import is for a deferred library. |
| 2809 */ | 2809 */ |
| 2810 void set deferred(bool isDeferred) { | 2810 void set deferred(bool isDeferred) { |
| 2811 setModifier(Modifier.DEFERRED, isDeferred); | 2811 setModifier(Modifier.DEFERRED, isDeferred); |
| 2812 } | 2812 } |
| 2813 | 2813 |
| 2814 @override | 2814 @override |
| 2815 String get identifier => | 2815 String get identifier => "${importedLibrary.identifier}@$nameOffset"; |
| 2816 "${(importedLibrary as LibraryElementImpl).identifier}@$nameOffset"; | |
| 2817 | 2816 |
| 2818 @override | 2817 @override |
| 2819 bool get isDeferred => hasModifier(Modifier.DEFERRED); | 2818 bool get isDeferred => hasModifier(Modifier.DEFERRED); |
| 2820 | 2819 |
| 2821 @override | 2820 @override |
| 2822 ElementKind get kind => ElementKind.IMPORT; | 2821 ElementKind get kind => ElementKind.IMPORT; |
| 2823 | 2822 |
| 2824 @override | 2823 @override |
| 2825 accept(ElementVisitor visitor) => visitor.visitImportElement(this); | 2824 accept(ElementVisitor visitor) => visitor.visitImportElement(this); |
| 2826 | 2825 |
| (...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3230 } | 3229 } |
| 3231 | 3230 |
| 3232 @override | 3231 @override |
| 3233 List<LibraryElement> get visibleLibraries { | 3232 List<LibraryElement> get visibleLibraries { |
| 3234 Set<LibraryElement> visibleLibraries = new Set(); | 3233 Set<LibraryElement> visibleLibraries = new Set(); |
| 3235 _addVisibleLibraries(visibleLibraries, false); | 3234 _addVisibleLibraries(visibleLibraries, false); |
| 3236 return new List.from(visibleLibraries); | 3235 return new List.from(visibleLibraries); |
| 3237 } | 3236 } |
| 3238 | 3237 |
| 3239 @override | 3238 @override |
| 3240 bool operator ==(Object object) => | 3239 bool operator ==(Object object) => object is LibraryElementImpl && |
| 3241 object is LibraryElementImpl && | |
| 3242 _definingCompilationUnit == object.definingCompilationUnit; | 3240 _definingCompilationUnit == object.definingCompilationUnit; |
| 3243 | 3241 |
| 3244 @override | 3242 @override |
| 3245 accept(ElementVisitor visitor) => visitor.visitLibraryElement(this); | 3243 accept(ElementVisitor visitor) => visitor.visitLibraryElement(this); |
| 3246 | 3244 |
| 3247 /** | 3245 /** |
| 3248 * Create the [FunctionElement] to be returned by [loadLibraryFunction], | 3246 * Create the [FunctionElement] to be returned by [loadLibraryFunction], |
| 3249 * using types provided by [typeProvider]. | 3247 * using types provided by [typeProvider]. |
| 3250 */ | 3248 */ |
| 3251 void createLoadLibraryFunction(TypeProvider typeProvider) { | 3249 void createLoadLibraryFunction(TypeProvider typeProvider) { |
| (...skipping 868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4120 */ | 4118 */ |
| 4121 class PropertyAccessorElementImpl extends ExecutableElementImpl | 4119 class PropertyAccessorElementImpl extends ExecutableElementImpl |
| 4122 implements PropertyAccessorElement { | 4120 implements PropertyAccessorElement { |
| 4123 /** | 4121 /** |
| 4124 * The variable associated with this accessor. | 4122 * The variable associated with this accessor. |
| 4125 */ | 4123 */ |
| 4126 PropertyInducingElement variable; | 4124 PropertyInducingElement variable; |
| 4127 | 4125 |
| 4128 /** | 4126 /** |
| 4129 * Initialize a newly created property accessor element to have the given | 4127 * Initialize a newly created property accessor element to have the given |
| 4128 * [name] and [offset]. |
| 4129 */ |
| 4130 PropertyAccessorElementImpl(String name, int offset) : super(name, offset); |
| 4131 |
| 4132 /** |
| 4133 * Initialize a newly created property accessor element to have the given |
| 4130 * [name]. | 4134 * [name]. |
| 4131 */ | 4135 */ |
| 4132 PropertyAccessorElementImpl.forNode(Identifier name) : super.forNode(name); | 4136 PropertyAccessorElementImpl.forNode(Identifier name) : super.forNode(name); |
| 4133 | 4137 |
| 4134 /** | 4138 /** |
| 4135 * Initialize a newly created synthetic property accessor element to be | 4139 * Initialize a newly created synthetic property accessor element to be |
| 4136 * associated with the given [variable]. | 4140 * associated with the given [variable]. |
| 4137 */ | 4141 */ |
| 4138 PropertyAccessorElementImpl.forVariable(PropertyInducingElementImpl variable) | 4142 PropertyAccessorElementImpl.forVariable(PropertyInducingElementImpl variable) |
| 4139 : super(variable.name, variable.nameOffset) { | 4143 : super(variable.name, variable.nameOffset) { |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4215 } | 4219 } |
| 4216 | 4220 |
| 4217 /** | 4221 /** |
| 4218 * Set whether this accessor is static. | 4222 * Set whether this accessor is static. |
| 4219 */ | 4223 */ |
| 4220 void set static(bool isStatic) { | 4224 void set static(bool isStatic) { |
| 4221 setModifier(Modifier.STATIC, isStatic); | 4225 setModifier(Modifier.STATIC, isStatic); |
| 4222 } | 4226 } |
| 4223 | 4227 |
| 4224 @override | 4228 @override |
| 4225 bool operator ==(Object object) => | 4229 bool operator ==(Object object) => super == object && |
| 4226 super == object && | |
| 4227 isGetter == (object as PropertyAccessorElement).isGetter; | 4230 isGetter == (object as PropertyAccessorElement).isGetter; |
| 4228 | 4231 |
| 4229 @override | 4232 @override |
| 4230 accept(ElementVisitor visitor) => visitor.visitPropertyAccessorElement(this); | 4233 accept(ElementVisitor visitor) => visitor.visitPropertyAccessorElement(this); |
| 4231 | 4234 |
| 4232 @override | 4235 @override |
| 4233 void appendTo(StringBuffer buffer) { | 4236 void appendTo(StringBuffer buffer) { |
| 4234 buffer.write(isGetter ? "get " : "set "); | 4237 buffer.write(isGetter ? "get " : "set "); |
| 4235 buffer.write(variable.displayName); | 4238 buffer.write(variable.displayName); |
| 4236 super.appendTo(buffer); | 4239 super.appendTo(buffer); |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4559 | 4562 |
| 4560 @override | 4563 @override |
| 4561 void visitElement(Element element) { | 4564 void visitElement(Element element) { |
| 4562 int offset = element.nameOffset; | 4565 int offset = element.nameOffset; |
| 4563 if (offset != -1) { | 4566 if (offset != -1) { |
| 4564 map[offset] = element; | 4567 map[offset] = element; |
| 4565 } | 4568 } |
| 4566 super.visitElement(element); | 4569 super.visitElement(element); |
| 4567 } | 4570 } |
| 4568 } | 4571 } |
| OLD | NEW |