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

Side by Side Diff: pkg/analyzer/lib/src/dart/resolver/scope.dart

Issue 2235373003: Fix summary handling of unresolved imports, exports, and parts. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Simplify `allowMissingFiles` Created 4 years, 4 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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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.dart.resolver.scope; 5 library analyzer.src.dart.resolver.scope;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analyzer/dart/ast/ast.dart'; 9 import 'package:analyzer/dart/ast/ast.dart';
10 import 'package:analyzer/dart/element/element.dart'; 10 import 'package:analyzer/dart/element/element.dart';
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 ImportElement importElement) => 445 ImportElement importElement) =>
446 importElement.combinators.where((NamespaceCombinator combinator) => 446 importElement.combinators.where((NamespaceCombinator combinator) =>
447 combinator is ShowElementCombinator); 447 combinator is ShowElementCombinator);
448 if (node is PrefixedIdentifier) { 448 if (node is PrefixedIdentifier) {
449 String prefix = node.prefix.name; 449 String prefix = node.prefix.name;
450 String name = node.identifier.name; 450 String name = node.identifier.name;
451 List<ImportElement> imports = _definingLibrary.imports; 451 List<ImportElement> imports = _definingLibrary.imports;
452 int count = imports.length; 452 int count = imports.length;
453 for (int i = 0; i < count; i++) { 453 for (int i = 0; i < count; i++) {
454 ImportElement importElement = imports[i]; 454 ImportElement importElement = imports[i];
455 if (importElement.prefix?.name == prefix && !importElement.uriExists) { 455 if (importElement.prefix?.name == prefix &&
456 importElement.importedLibrary?.isSynthetic != false) {
456 Iterable<NamespaceCombinator> showCombinators = 457 Iterable<NamespaceCombinator> showCombinators =
457 getShowCombinators(importElement); 458 getShowCombinators(importElement);
458 if (showCombinators.isEmpty) { 459 if (showCombinators.isEmpty) {
459 return true; 460 return true;
460 } 461 }
461 for (ShowElementCombinator combinator in showCombinators) { 462 for (ShowElementCombinator combinator in showCombinators) {
462 if (combinator.shownNames.contains(name)) { 463 if (combinator.shownNames.contains(name)) {
463 return true; 464 return true;
464 } 465 }
465 } 466 }
466 } 467 }
467 } 468 }
468 } else if (node is SimpleIdentifier) { 469 } else if (node is SimpleIdentifier) {
469 String name = node.name; 470 String name = node.name;
470 List<ImportElement> imports = _definingLibrary.imports; 471 List<ImportElement> imports = _definingLibrary.imports;
471 int count = imports.length; 472 int count = imports.length;
472 for (int i = 0; i < count; i++) { 473 for (int i = 0; i < count; i++) {
473 ImportElement importElement = imports[i]; 474 ImportElement importElement = imports[i];
474 if (importElement.prefix == null && !importElement.uriExists) { 475 if (importElement.prefix == null &&
476 importElement.importedLibrary?.isSynthetic != false) {
475 for (ShowElementCombinator combinator 477 for (ShowElementCombinator combinator
476 in getShowCombinators(importElement)) { 478 in getShowCombinators(importElement)) {
477 if (combinator.shownNames.contains(name)) { 479 if (combinator.shownNames.contains(name)) {
478 return true; 480 return true;
479 } 481 }
480 } 482 }
481 } 483 }
482 } 484 }
483 } 485 }
484 return false; 486 return false;
(...skipping 783 matching lines...) Expand 10 before | Expand all | Expand 10 after
1268 1270
1269 /** 1271 /**
1270 * Define the type parameters declared by the [classElement]. 1272 * Define the type parameters declared by the [classElement].
1271 */ 1273 */
1272 void _defineTypeParameters(ClassElement classElement) { 1274 void _defineTypeParameters(ClassElement classElement) {
1273 for (TypeParameterElement typeParameter in classElement.typeParameters) { 1275 for (TypeParameterElement typeParameter in classElement.typeParameters) {
1274 define(typeParameter); 1276 define(typeParameter);
1275 } 1277 }
1276 } 1278 }
1277 } 1279 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/dart/element/handle.dart ('k') | pkg/analyzer/lib/src/generated/resolver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698