Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Side by Side Diff: pkg/analyzer/lib/src/context/context.dart

Issue 1127403004: Return empty contents for not existing sources. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/analyzer/lib/src/context/cache.dart ('k') | pkg/analyzer/lib/src/task/dart.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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.context.context; 5 library analyzer.src.context.context;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 9
10 import 'package:analyzer/src/cancelable_future.dart'; 10 import 'package:analyzer/src/cancelable_future.dart';
(...skipping 1007 matching lines...) Expand 10 before | Expand all | Expand 10 after
1018 bool isServerLibrary(Source librarySource) { 1018 bool isServerLibrary(Source librarySource) {
1019 CacheEntry entry = _cache.get(librarySource); 1019 CacheEntry entry = _cache.get(librarySource);
1020 return !entry.getValue(IS_CLIENT) && entry.getValue(IS_LAUNCHABLE); 1020 return !entry.getValue(IS_CLIENT) && entry.getValue(IS_LAUNCHABLE);
1021 } 1021 }
1022 1022
1023 @override 1023 @override
1024 CompilationUnit parseCompilationUnit(Source source) { 1024 CompilationUnit parseCompilationUnit(Source source) {
1025 if (!AnalysisEngine.isDartFileName(source.shortName)) { 1025 if (!AnalysisEngine.isDartFileName(source.shortName)) {
1026 return null; 1026 return null;
1027 } 1027 }
1028 try {
1029 getContents(source);
1030 } catch (exception, stackTrace) {
1031 throw new AnalysisException('Could not get contents of $source',
1032 new CaughtException(exception, stackTrace));
1033 }
1028 return _computeResult(source, PARSED_UNIT); 1034 return _computeResult(source, PARSED_UNIT);
1029 } 1035 }
1030 1036
1031 @override 1037 @override
1032 ht.HtmlUnit parseHtmlUnit(Source source) { 1038 ht.HtmlUnit parseHtmlUnit(Source source) {
1033 if (!AnalysisEngine.isHtmlFileName(source.shortName)) { 1039 if (!AnalysisEngine.isHtmlFileName(source.shortName)) {
1034 return null; 1040 return null;
1035 } 1041 }
1036 // TODO(brianwilkerson) Implement HTML analysis. 1042 // TODO(brianwilkerson) Implement HTML analysis.
1037 return null; //_computeResult(source, null); 1043 return null; //_computeResult(source, null);
(...skipping 990 matching lines...) Expand 10 before | Expand all | Expand 10 after
2028 PendingFuture pendingFuture = 2034 PendingFuture pendingFuture =
2029 new PendingFuture<T>(_context, target, computeValue); 2035 new PendingFuture<T>(_context, target, computeValue);
2030 if (!pendingFuture.evaluate(entry)) { 2036 if (!pendingFuture.evaluate(entry)) {
2031 _context._pendingFutureTargets 2037 _context._pendingFutureTargets
2032 .putIfAbsent(target, () => <PendingFuture>[]) 2038 .putIfAbsent(target, () => <PendingFuture>[])
2033 .add(pendingFuture); 2039 .add(pendingFuture);
2034 } 2040 }
2035 return pendingFuture.future; 2041 return pendingFuture.future;
2036 } 2042 }
2037 } 2043 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/context/cache.dart ('k') | pkg/analyzer/lib/src/task/dart.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698