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.generated.incremental_resolution_validator; | 5 library analyzer.src.generated.incremental_resolution_validator; |
6 | 6 |
7 import 'package:analyzer/src/generated/ast.dart'; | 7 import 'package:analyzer/src/generated/ast.dart'; |
8 import 'package:analyzer/src/generated/element.dart'; | 8 import 'package:analyzer/src/generated/element.dart'; |
9 | 9 |
10 /** | 10 /** |
(...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
836 if (locationA != locationB) { | 836 if (locationA != locationB) { |
837 int offset = other.offset; | 837 int offset = other.offset; |
838 _fail('[$offset]\nExpected: $b ($locationB)\n Actual: $a ($locationA)'); | 838 _fail('[$offset]\nExpected: $b ($locationB)\n Actual: $a ($locationA)'); |
839 } | 839 } |
840 if (a == null && b == null) { | 840 if (a == null && b == null) { |
841 return; | 841 return; |
842 } | 842 } |
843 if (a.nameOffset != b.nameOffset) { | 843 if (a.nameOffset != b.nameOffset) { |
844 _fail('Expected: ${b.nameOffset}\n Actual: ${a.nameOffset}'); | 844 _fail('Expected: ${b.nameOffset}\n Actual: ${a.nameOffset}'); |
845 } | 845 } |
| 846 if (a is LocalElement && b is LocalElement) { |
| 847 if (a.visibleRange != b.visibleRange) { |
| 848 _fail('Expected: ${b.visibleRange}\nActual: ${a.visibleRange}'); |
| 849 } |
| 850 } |
846 } | 851 } |
847 | 852 |
848 void _verifyType(DartType a, DartType b) { | 853 void _verifyType(DartType a, DartType b) { |
849 if (!validateTypes) { | 854 if (!validateTypes) { |
850 return; | 855 return; |
851 } | 856 } |
852 if (a != b) { | 857 if (a != b) { |
853 int offset = other.offset; | 858 int offset = other.offset; |
854 _fail('[$offset]\nExpected: $b\n Actual: $a'); | 859 _fail('[$offset]\nExpected: $b\n Actual: $a'); |
855 } | 860 } |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
944 * package:project/my_lib.dart -> my_lib.dart | 949 * package:project/my_lib.dart -> my_lib.dart |
945 */ | 950 */ |
946 static String _getShortElementLocationUri(String uri) { | 951 static String _getShortElementLocationUri(String uri) { |
947 int index = uri.lastIndexOf('/'); | 952 int index = uri.lastIndexOf('/'); |
948 if (index == -1) { | 953 if (index == -1) { |
949 return uri; | 954 return uri; |
950 } | 955 } |
951 return uri.substring(index + 1); | 956 return uri.substring(index + 1); |
952 } | 957 } |
953 } | 958 } |
OLD | NEW |