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

Side by Side Diff: pkg/analyzer/lib/src/summary/package_bundle_reader.dart

Issue 1946723002: Fix bug in summary deserialization (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 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
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/summary/summary_sdk.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 import 'dart:io' as io; 1 import 'dart:io' as io;
2 2
3 import 'package:analyzer/dart/element/element.dart'; 3 import 'package:analyzer/dart/element/element.dart';
4 import 'package:analyzer/src/context/cache.dart'; 4 import 'package:analyzer/src/context/cache.dart';
5 import 'package:analyzer/src/context/context.dart'; 5 import 'package:analyzer/src/context/context.dart';
6 import 'package:analyzer/src/dart/element/element.dart';
6 import 'package:analyzer/src/generated/engine.dart'; 7 import 'package:analyzer/src/generated/engine.dart';
7 import 'package:analyzer/src/generated/java_io.dart'; 8 import 'package:analyzer/src/generated/java_io.dart';
8 import 'package:analyzer/src/generated/resolver.dart'; 9 import 'package:analyzer/src/generated/resolver.dart';
9 import 'package:analyzer/src/generated/source.dart'; 10 import 'package:analyzer/src/generated/source.dart';
10 import 'package:analyzer/src/generated/source_io.dart'; 11 import 'package:analyzer/src/generated/source_io.dart';
11 import 'package:analyzer/src/summary/idl.dart'; 12 import 'package:analyzer/src/summary/idl.dart';
12 import 'package:analyzer/src/summary/resynthesize.dart'; 13 import 'package:analyzer/src/summary/resynthesize.dart';
13 import 'package:analyzer/src/summary/summary_sdk.dart'; 14 import 'package:analyzer/src/summary/summary_sdk.dart';
14 import 'package:analyzer/src/task/dart.dart'; 15 import 'package:analyzer/src/task/dart.dart';
15 import 'package:analyzer/task/dart.dart'; 16 import 'package:analyzer/task/dart.dart';
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 if (_resynthesizer._dataStore.linkedMap.containsKey(uriString)) { 80 if (_resynthesizer._dataStore.linkedMap.containsKey(uriString)) {
80 entry.setValue(result, SourceKind.LIBRARY, TargetedResult.EMPTY_LIST); 81 entry.setValue(result, SourceKind.LIBRARY, TargetedResult.EMPTY_LIST);
81 return true; 82 return true;
82 } 83 }
83 if (_resynthesizer._dataStore.unlinkedMap.containsKey(uriString)) { 84 if (_resynthesizer._dataStore.unlinkedMap.containsKey(uriString)) {
84 entry.setValue(result, SourceKind.PART, TargetedResult.EMPTY_LIST); 85 entry.setValue(result, SourceKind.PART, TargetedResult.EMPTY_LIST);
85 return true; 86 return true;
86 } 87 }
87 return false; 88 return false;
88 } 89 }
90 } else if (target is LibrarySpecificUnit) {
91 String uriString = target.library.uri.toString();
92 if (!_resynthesizer.hasLibrarySummary(uriString)) {
93 print('Not in summary: $result of $target ($uriString)');
scheglov 2016/05/03 18:56:16 We don't need this anymore.
Brian Wilkerson 2016/05/03 19:03:43 Good catch, done.
94 return false;
95 }
96 if (result == CREATED_RESOLVED_UNIT1 ||
97 result == CREATED_RESOLVED_UNIT2 ||
98 result == CREATED_RESOLVED_UNIT3 ||
99 result == CREATED_RESOLVED_UNIT4 ||
100 result == CREATED_RESOLVED_UNIT5 ||
101 result == CREATED_RESOLVED_UNIT6 ||
102 result == CREATED_RESOLVED_UNIT7 ||
103 result == CREATED_RESOLVED_UNIT8 ||
104 result == CREATED_RESOLVED_UNIT9 ||
105 result == CREATED_RESOLVED_UNIT10 ||
106 result == CREATED_RESOLVED_UNIT11 ||
107 result == CREATED_RESOLVED_UNIT12) {
108 entry.setValue(result, true, TargetedResult.EMPTY_LIST);
109 return true;
110 }
111 if (result == COMPILATION_UNIT_ELEMENT) {
112 String libraryUri = target.library.uri.toString();
113 String unitUri = target.unit.uri.toString();
114 CompilationUnitElement unit = _resynthesizer.getElement(
115 new ElementLocationImpl.con3(<String>[libraryUri, unitUri]));
116 if (unit != null) {
117 entry.setValue(result, unit, TargetedResult.EMPTY_LIST);
118 return true;
119 }
120 }
89 } else if (target is VariableElement) { 121 } else if (target is VariableElement) {
90 if (!_resynthesizer 122 if (!_resynthesizer
91 .hasLibrarySummary(target.library.source.uri.toString())) { 123 .hasLibrarySummary(target.library.source.uri.toString())) {
92 return false; 124 return false;
93 } 125 }
94 if (result == PROPAGATED_VARIABLE || result == INFERRED_STATIC_VARIABLE) { 126 if (result == PROPAGATED_VARIABLE || result == INFERRED_STATIC_VARIABLE) {
95 entry.setValue(result, target, TargetedResult.EMPTY_LIST); 127 entry.setValue(result, target, TargetedResult.EMPTY_LIST);
96 return true; 128 return true;
97 } 129 }
98 } 130 }
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 * also provides [summaryPath]. 295 * also provides [summaryPath].
264 */ 296 */
265 class _InSummaryFallbackSource extends FileBasedSource 297 class _InSummaryFallbackSource extends FileBasedSource
266 implements InSummarySource { 298 implements InSummarySource {
267 @override 299 @override
268 final String summaryPath; 300 final String summaryPath;
269 301
270 _InSummaryFallbackSource(JavaFile file, Uri uri, this.summaryPath) 302 _InSummaryFallbackSource(JavaFile file, Uri uri, this.summaryPath)
271 : super(file, uri); 303 : super(file, uri);
272 } 304 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/summary/summary_sdk.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698