| 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.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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |