OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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.task.dart; | 5 library analyzer.src.task.dart; |
6 | 6 |
7 import 'dart:collection'; | 7 import 'dart:collection'; |
8 | 8 |
9 import 'package:analyzer/src/context/cache.dart'; | 9 import 'package:analyzer/src/context/cache.dart'; |
10 import 'package:analyzer/src/generated/ast.dart'; | 10 import 'package:analyzer/src/generated/ast.dart'; |
(...skipping 3794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3805 if (context.getModificationStamp(target.source) < 0) { | 3805 if (context.getModificationStamp(target.source) < 0) { |
3806 String message = 'Content could not be read'; | 3806 String message = 'Content could not be read'; |
3807 if (context is InternalAnalysisContext) { | 3807 if (context is InternalAnalysisContext) { |
3808 CacheEntry entry = | 3808 CacheEntry entry = |
3809 (context as InternalAnalysisContext).getCacheEntry(target); | 3809 (context as InternalAnalysisContext).getCacheEntry(target); |
3810 CaughtException exception = entry.exception; | 3810 CaughtException exception = entry.exception; |
3811 if (exception != null) { | 3811 if (exception != null) { |
3812 message = exception.toString(); | 3812 message = exception.toString(); |
3813 } | 3813 } |
3814 } | 3814 } |
3815 errorListener.onError(new AnalysisError( | 3815 if (source.exists()) { |
3816 source, 0, 0, ScannerErrorCode.UNABLE_GET_CONTENT, [message])); | 3816 errorListener.onError(new AnalysisError( |
| 3817 source, 0, 0, ScannerErrorCode.UNABLE_GET_CONTENT, [message])); |
| 3818 } |
3817 } | 3819 } |
3818 if (target is DartScript) { | 3820 if (target is DartScript) { |
3819 DartScript script = target; | 3821 DartScript script = target; |
3820 List<ScriptFragment> fragments = script.fragments; | 3822 List<ScriptFragment> fragments = script.fragments; |
3821 if (fragments.length < 1) { | 3823 if (fragments.length < 1) { |
3822 throw new AnalysisException('Cannot scan scripts with no fragments'); | 3824 throw new AnalysisException('Cannot scan scripts with no fragments'); |
3823 } else if (fragments.length > 1) { | 3825 } else if (fragments.length > 1) { |
3824 throw new AnalysisException( | 3826 throw new AnalysisException( |
3825 'Cannot scan scripts with multiple fragments'); | 3827 'Cannot scan scripts with multiple fragments'); |
3826 } | 3828 } |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4126 | 4128 |
4127 @override | 4129 @override |
4128 bool moveNext() { | 4130 bool moveNext() { |
4129 if (_newSources.isEmpty) { | 4131 if (_newSources.isEmpty) { |
4130 return false; | 4132 return false; |
4131 } | 4133 } |
4132 currentTarget = _newSources.removeLast(); | 4134 currentTarget = _newSources.removeLast(); |
4133 return true; | 4135 return true; |
4134 } | 4136 } |
4135 } | 4137 } |
OLD | NEW |