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

Unified Diff: pkg/analyzer_cli/lib/src/analyzer_impl.dart

Issue 2809523002: Issue 29288. Resynthesize Import/Export/PartElement for every directive. (Closed)
Patch Set: Created 3 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 side-by-side diff with in-line comments
Download patch
Index: pkg/analyzer_cli/lib/src/analyzer_impl.dart
diff --git a/pkg/analyzer_cli/lib/src/analyzer_impl.dart b/pkg/analyzer_cli/lib/src/analyzer_impl.dart
index a4c18310f679203ceaae2e43861d8355ad1569bd..1aab902511411e5887b91b63c8e50269e056259a 100644
--- a/pkg/analyzer_cli/lib/src/analyzer_impl.dart
+++ b/pkg/analyzer_cli/lib/src/analyzer_impl.dart
@@ -81,11 +81,13 @@ class AnalyzerImpl {
void addCompilationUnitSource(
CompilationUnitElement unit, Set<CompilationUnitElement> units) {
- if (unit == null || units.contains(unit)) {
+ if (unit == null || !units.add(unit)) {
return;
}
- units.add(unit);
- sources.add(unit.source);
+ Source source = unit.source;
+ if (source != null) {
+ sources.add(source);
+ }
}
void addLibrarySources(LibraryElement library, Set<LibraryElement> libraries,

Powered by Google App Engine
This is Rietveld 408576698