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

Unified Diff: pkg/analyzer/lib/src/dart/analysis/file_state.dart

Issue 2662363002: The file is a library, if it has a 'library' directive. (Closed)
Patch Set: Created 3 years, 11 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
« no previous file with comments | « no previous file | pkg/analyzer/test/src/dart/analysis/file_state_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/dart/analysis/file_state.dart
diff --git a/pkg/analyzer/lib/src/dart/analysis/file_state.dart b/pkg/analyzer/lib/src/dart/analysis/file_state.dart
index 619a0350b48fe0d307c4d2003a48e2d1b197dc47..facf11f3a5912bfeab5009df057429bfb36ab812 100644
--- a/pkg/analyzer/lib/src/dart/analysis/file_state.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/file_state.dart
@@ -191,9 +191,10 @@ class FileState {
List<FileState> get importedFiles => _importedFiles;
/**
- * Return `true` if the file has a `part of` directive, so is probably a part.
+ * Return `true` if the file does not have a `library` directive, and has a
+ * `part of` directive, so is probably a part.
*/
- bool get isPart => _unlinked.isPartOf;
+ bool get isPart => _unlinked.libraryNameOffset == 0 && _unlinked.isPartOf;
Brian Wilkerson 2017/01/31 20:33:00 I'm concerned about this because it appears that u
/**
* If the file [isPart], return a currently know library the file is a part
« no previous file with comments | « no previous file | pkg/analyzer/test/src/dart/analysis/file_state_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698