| 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.summary.summary_sdk; | 5 library analyzer.src.summary.summary_sdk; |
| 6 | 6 |
| 7 import 'package:analyzer/dart/element/element.dart'; | 7 import 'package:analyzer/dart/element/element.dart'; |
| 8 import 'package:analyzer/dart/element/type.dart'; | 8 import 'package:analyzer/dart/element/type.dart'; |
| 9 import 'package:analyzer/src/context/cache.dart' show CacheEntry; | 9 import 'package:analyzer/src/context/cache.dart' show CacheEntry; |
| 10 import 'package:analyzer/src/context/context.dart'; | 10 import 'package:analyzer/src/context/context.dart'; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 final SdkBundle bundle; | 39 final SdkBundle bundle; |
| 40 final SummaryTypeProvider typeProvider = new SummaryTypeProvider(); | 40 final SummaryTypeProvider typeProvider = new SummaryTypeProvider(); |
| 41 | 41 |
| 42 SummaryResynthesizer resynthesizer; | 42 SummaryResynthesizer resynthesizer; |
| 43 | 43 |
| 44 SummarySdkAnalysisContext(this.bundle); | 44 SummarySdkAnalysisContext(this.bundle); |
| 45 | 45 |
| 46 @override | 46 @override |
| 47 bool aboutToComputeResult(CacheEntry entry, ResultDescriptor result) { | 47 bool aboutToComputeResult(CacheEntry entry, ResultDescriptor result) { |
| 48 if (resynthesizer == null) { | 48 if (resynthesizer == null) { |
| 49 resynthesizer = new SummaryResynthesizer(this, typeProvider, | 49 resynthesizer = new SummaryResynthesizer( |
| 50 _getPrelinkedSummary, _getUnlinkedSummary, sourceFactory); | 50 null, |
| 51 this, |
| 52 typeProvider, |
| 53 (String uri) => uri.startsWith('dart:'), |
| 54 _getPrelinkedSummary, |
| 55 _getUnlinkedSummary, |
| 56 sourceFactory); |
| 51 _buildCoreLibrary(); | 57 _buildCoreLibrary(); |
| 52 _buildAsyncLibrary(); | 58 _buildAsyncLibrary(); |
| 53 } | 59 } |
| 54 if (result == TYPE_PROVIDER) { | 60 if (result == TYPE_PROVIDER) { |
| 55 entry.setValue(result, typeProvider, TargetedResult.EMPTY_LIST); | 61 entry.setValue(result, typeProvider, TargetedResult.EMPTY_LIST); |
| 56 return true; | 62 return true; |
| 57 } | 63 } |
| 58 AnalysisTarget target = entry.target; | 64 AnalysisTarget target = entry.target; |
| 59 // print('SummarySdkAnalysisContext: $result of $target'); | 65 // print('SummarySdkAnalysisContext: $result of $target'); |
| 60 if (target is Source && target.isInSystemLibrary) { | 66 if (target is Source && target.isInSystemLibrary) { |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 * throw a [StateError] if there is no class with the given name. | 359 * throw a [StateError] if there is no class with the given name. |
| 354 */ | 360 */ |
| 355 InterfaceType _getType(LibraryElement library, String name) { | 361 InterfaceType _getType(LibraryElement library, String name) { |
| 356 Element element = library.getType(name); | 362 Element element = library.getType(name); |
| 357 if (element == null) { | 363 if (element == null) { |
| 358 throw new StateError("No definition of type $name"); | 364 throw new StateError("No definition of type $name"); |
| 359 } | 365 } |
| 360 return (element as ClassElement).type; | 366 return (element as ClassElement).type; |
| 361 } | 367 } |
| 362 } | 368 } |
| OLD | NEW |