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

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

Issue 1854863002: Issue 26096. Explicitly compute the result that ensures that directives are resolved in units. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Fix for a review comment. Created 4 years, 8 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 | « pkg/analyzer/lib/src/plugin/engine_plugin.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.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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 return false; 87 return false;
88 } else { 88 } else {
89 // throw new UnimplementedError('$result of $target'); 89 // throw new UnimplementedError('$result of $target');
90 } 90 }
91 } 91 }
92 if (target is LibrarySpecificUnit) { 92 if (target is LibrarySpecificUnit) {
93 if (target.library == null || !target.library.isInSystemLibrary) { 93 if (target.library == null || !target.library.isInSystemLibrary) {
94 return false; 94 return false;
95 } 95 }
96 if (result == CREATED_RESOLVED_UNIT1 || 96 if (result == CREATED_RESOLVED_UNIT1 ||
97 result == CREATED_RESOLVED_UNIT2 ||
Brian Wilkerson 2016/04/01 20:12:53 Not sure why this isn't still part of the list.
98 result == CREATED_RESOLVED_UNIT3 || 97 result == CREATED_RESOLVED_UNIT3 ||
99 result == CREATED_RESOLVED_UNIT4 || 98 result == CREATED_RESOLVED_UNIT4 ||
100 result == CREATED_RESOLVED_UNIT5 || 99 result == CREATED_RESOLVED_UNIT5 ||
101 result == CREATED_RESOLVED_UNIT6 || 100 result == CREATED_RESOLVED_UNIT6 ||
102 result == CREATED_RESOLVED_UNIT7 || 101 result == CREATED_RESOLVED_UNIT7 ||
103 result == CREATED_RESOLVED_UNIT8 || 102 result == CREATED_RESOLVED_UNIT8 ||
104 result == CREATED_RESOLVED_UNIT9) { 103 result == CREATED_RESOLVED_UNIT9 ||
104 result == CREATED_RESOLVED_UNIT10) {
105 entry.setValue(result, true, TargetedResult.EMPTY_LIST); 105 entry.setValue(result, true, TargetedResult.EMPTY_LIST);
106 return true; 106 return true;
107 } 107 }
108 if (result == COMPILATION_UNIT_ELEMENT) { 108 if (result == COMPILATION_UNIT_ELEMENT) {
109 String libraryUri = target.library.uri.toString(); 109 String libraryUri = target.library.uri.toString();
110 String unitUri = target.unit.uri.toString(); 110 String unitUri = target.unit.uri.toString();
111 CompilationUnitElement unit = resynthesizer.getElement( 111 CompilationUnitElement unit = resynthesizer.getElement(
112 new ElementLocationImpl.con3(<String>[libraryUri, unitUri])); 112 new ElementLocationImpl.con3(<String>[libraryUri, unitUri]));
113 if (unit != null) { 113 if (unit != null) {
114 entry.setValue(result, unit, TargetedResult.EMPTY_LIST); 114 entry.setValue(result, unit, TargetedResult.EMPTY_LIST);
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 * throw a [StateError] if there is no class with the given name. 418 * throw a [StateError] if there is no class with the given name.
419 */ 419 */
420 InterfaceType _getType(LibraryElement library, String name) { 420 InterfaceType _getType(LibraryElement library, String name) {
421 Element element = library.getType(name); 421 Element element = library.getType(name);
422 if (element == null) { 422 if (element == null) {
423 throw new StateError("No definition of type $name"); 423 throw new StateError("No definition of type $name");
424 } 424 }
425 return (element as ClassElement).type; 425 return (element as ClassElement).type;
426 } 426 }
427 } 427 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/plugin/engine_plugin.dart ('k') | pkg/analyzer/lib/src/task/dart.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698