| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 elements; | 5 library elements; |
| 6 | 6 |
| 7 import 'package:front_end/src/fasta/parser/async_modifier.dart' | 7 import 'package:front_end/src/fasta/parser/async_modifier.dart' |
| 8 show AsyncModifier; | 8 show AsyncModifier; |
| 9 | 9 |
| 10 import '../common.dart'; | 10 import '../common.dart'; |
| (...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 736 CompilationUnitElement a, CompilationUnitElement b) { | 736 CompilationUnitElement a, CompilationUnitElement b) { |
| 737 if (a == b) return 0; | 737 if (a == b) return 0; |
| 738 // Compilation units are compared only within the same library so we expect | 738 // Compilation units are compared only within the same library so we expect |
| 739 // the Uris to usually be clustered together with a common scheme and path | 739 // the Uris to usually be clustered together with a common scheme and path |
| 740 // prefix. | 740 // prefix. |
| 741 Uri aUri = a.script.readableUri; | 741 Uri aUri = a.script.readableUri; |
| 742 Uri bUri = b.script.readableUri; | 742 Uri bUri = b.script.readableUri; |
| 743 return '${aUri}'.compareTo('${bUri}'); | 743 return '${aUri}'.compareTo('${bUri}'); |
| 744 } | 744 } |
| 745 | 745 |
| 746 static List<Element> sortedByPosition(Iterable<Element> elements) { | 746 static List<E> sortedByPosition<E extends Element>(Iterable<E> elements) { |
| 747 return elements.toList()..sort(compareByPosition); | 747 return elements.toList()..sort(compareByPosition); |
| 748 } | 748 } |
| 749 | 749 |
| 750 static bool isFixedListConstructorCall( | 750 static bool isFixedListConstructorCall( |
| 751 ConstructorEntity element, Send node, CommonElements commonElements) { | 751 ConstructorEntity element, Send node, CommonElements commonElements) { |
| 752 return commonElements.isUnnamedListConstructor(element) && | 752 return commonElements.isUnnamedListConstructor(element) && |
| 753 node.isCall && | 753 node.isCall && |
| 754 !node.arguments.isEmpty && | 754 !node.arguments.isEmpty && |
| 755 node.arguments.tail.isEmpty; | 755 node.arguments.tail.isEmpty; |
| 756 } | 756 } |
| (...skipping 1277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2034 /// by a field. | 2034 /// by a field. |
| 2035 bool get isDeclaredByField; | 2035 bool get isDeclaredByField; |
| 2036 | 2036 |
| 2037 /// Returns `true` if this member is abstract. | 2037 /// Returns `true` if this member is abstract. |
| 2038 bool get isAbstract; | 2038 bool get isAbstract; |
| 2039 | 2039 |
| 2040 /// If abstract, [implementation] points to the overridden concrete member, | 2040 /// If abstract, [implementation] points to the overridden concrete member, |
| 2041 /// if any. Otherwise [implementation] points to the member itself. | 2041 /// if any. Otherwise [implementation] points to the member itself. |
| 2042 Member get implementation; | 2042 Member get implementation; |
| 2043 } | 2043 } |
| OLD | NEW |