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 test.src.context.context_test; | 5 library test.src.context.context_test; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'package:analyzer/src/cancelable_future.dart'; | 9 import 'package:analyzer/src/cancelable_future.dart'; |
10 import 'package:analyzer/src/context/cache.dart'; | 10 import 'package:analyzer/src/context/cache.dart'; |
(...skipping 2015 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2026 ClassElement _findClass(CompilationUnitElement unit, String className) { | 2026 ClassElement _findClass(CompilationUnitElement unit, String className) { |
2027 for (ClassElement classElement in unit.types) { | 2027 for (ClassElement classElement in unit.types) { |
2028 if (classElement.displayName == className) { | 2028 if (classElement.displayName == className) { |
2029 return classElement; | 2029 return classElement; |
2030 } | 2030 } |
2031 } | 2031 } |
2032 return null; | 2032 return null; |
2033 } | 2033 } |
2034 | 2034 |
2035 void _flushAst(Source source) { | 2035 void _flushAst(Source source) { |
2036 CacheEntry entry = context.getReadableSourceEntryOrNull(new LibrarySpecificU
nit(source, source)); | 2036 CacheEntry entry = context |
| 2037 .getReadableSourceEntryOrNull(new LibrarySpecificUnit(source, source)); |
2037 entry.setState(RESOLVED_UNIT, CacheState.FLUSHED); | 2038 entry.setState(RESOLVED_UNIT, CacheState.FLUSHED); |
2038 } | 2039 } |
2039 | 2040 |
2040 IncrementalAnalysisCache _getIncrementalAnalysisCache( | 2041 IncrementalAnalysisCache _getIncrementalAnalysisCache( |
2041 AnalysisContextImpl context2) { | 2042 AnalysisContextImpl context2) { |
2042 return context2.test_incrementalAnalysisCache; | 2043 return context2.test_incrementalAnalysisCache; |
2043 } | 2044 } |
2044 | 2045 |
2045 List<Source> _getPriorityOrder(AnalysisContextImpl context2) { | 2046 List<Source> _getPriorityOrder(AnalysisContextImpl context2) { |
2046 return context2.test_priorityOrder; | 2047 return context2.test_priorityOrder; |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2118 : super(name, UriKind.FILE_URI); | 2119 : super(name, UriKind.FILE_URI); |
2119 | 2120 |
2120 @override | 2121 @override |
2121 TimestampedData<String> get contents { | 2122 TimestampedData<String> get contents { |
2122 throw 'Read error'; | 2123 throw 'Read error'; |
2123 } | 2124 } |
2124 | 2125 |
2125 @override | 2126 @override |
2126 bool exists() => true; | 2127 bool exists() => true; |
2127 } | 2128 } |
OLD | NEW |