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

Side by Side Diff: pkg/analyzer/lib/src/summary/summary_sdk.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
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.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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 if (result == CREATED_RESOLVED_UNIT1 || 97 if (result == CREATED_RESOLVED_UNIT1 ||
98 result == CREATED_RESOLVED_UNIT2 || 98 result == CREATED_RESOLVED_UNIT2 ||
99 result == CREATED_RESOLVED_UNIT3 || 99 result == CREATED_RESOLVED_UNIT3 ||
100 result == CREATED_RESOLVED_UNIT4 || 100 result == CREATED_RESOLVED_UNIT4 ||
101 result == CREATED_RESOLVED_UNIT5 || 101 result == CREATED_RESOLVED_UNIT5 ||
102 result == CREATED_RESOLVED_UNIT6 || 102 result == CREATED_RESOLVED_UNIT6 ||
103 result == CREATED_RESOLVED_UNIT7 || 103 result == CREATED_RESOLVED_UNIT7 ||
104 result == CREATED_RESOLVED_UNIT8 || 104 result == CREATED_RESOLVED_UNIT8 ||
105 result == CREATED_RESOLVED_UNIT9 || 105 result == CREATED_RESOLVED_UNIT9 ||
106 result == CREATED_RESOLVED_UNIT10 || 106 result == CREATED_RESOLVED_UNIT10 ||
107 result == CREATED_RESOLVED_UNIT11) { 107 result == CREATED_RESOLVED_UNIT11 ||
108 result == CREATED_RESOLVED_UNIT12) {
108 entry.setValue(result, true, TargetedResult.EMPTY_LIST); 109 entry.setValue(result, true, TargetedResult.EMPTY_LIST);
109 return true; 110 return true;
110 } 111 }
111 if (result == COMPILATION_UNIT_ELEMENT) { 112 if (result == COMPILATION_UNIT_ELEMENT) {
112 String libraryUri = target.library.uri.toString(); 113 String libraryUri = target.library.uri.toString();
113 String unitUri = target.unit.uri.toString(); 114 String unitUri = target.unit.uri.toString();
114 CompilationUnitElement unit = resynthesizer.getElement( 115 CompilationUnitElement unit = resynthesizer.getElement(
115 new ElementLocationImpl.con3(<String>[libraryUri, unitUri])); 116 new ElementLocationImpl.con3(<String>[libraryUri, unitUri]));
116 if (unit != null) { 117 if (unit != null) {
117 entry.setValue(result, unit, TargetedResult.EMPTY_LIST); 118 entry.setValue(result, unit, TargetedResult.EMPTY_LIST);
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 * throw a [StateError] if there is no class with the given name. 422 * throw a [StateError] if there is no class with the given name.
422 */ 423 */
423 InterfaceType _getType(LibraryElement library, String name) { 424 InterfaceType _getType(LibraryElement library, String name) {
424 Element element = library.getType(name); 425 Element element = library.getType(name);
425 if (element == null) { 426 if (element == null) {
426 throw new StateError("No definition of type $name"); 427 throw new StateError("No definition of type $name");
427 } 428 }
428 return (element as ClassElement).type; 429 return (element as ClassElement).type;
429 } 430 }
430 } 431 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698