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

Unified Diff: pkg/analyzer/lib/src/task/dart.dart

Issue 1140943005: Fix for invalidating results of a target being removed. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/lib/src/context/context.dart ('k') | pkg/analyzer/lib/src/task/general.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/task/dart.dart
diff --git a/pkg/analyzer/lib/src/task/dart.dart b/pkg/analyzer/lib/src/task/dart.dart
index 13af33f185b0d2b2dcb9675a1f7d853a78ad144b..9dc108257b24214576011c40a6aec86e73c1ad97 100644
--- a/pkg/analyzer/lib/src/task/dart.dart
+++ b/pkg/analyzer/lib/src/task/dart.dart
@@ -1302,42 +1302,40 @@ class BuildLibraryElementTask extends SourceBasedAnalysisTask {
PartDirective partDirective = directive;
StringLiteral partUri = partDirective.uri;
Source partSource = partDirective.source;
- if (context.exists(partSource)) {
- hasPartDirective = true;
- CompilationUnit partUnit = partUnitMap[partSource];
- CompilationUnitElementImpl partElement = partUnit.element;
- partElement.uriOffset = partUri.offset;
- partElement.uriEnd = partUri.end;
- partElement.uri = partDirective.uriContent;
- //
- // Validate that the part contains a part-of directive with the same
- // name as the library.
- //
- String partLibraryName =
- _getPartLibraryName(partSource, partUnit, directivesToResolve);
- if (partLibraryName == null) {
- errors.add(new AnalysisError(librarySource, partUri.offset,
- partUri.length, CompileTimeErrorCode.PART_OF_NON_PART,
- [partUri.toSource()]));
- } else if (libraryNameNode == null) {
- if (partsLibraryName == _UNKNOWN_LIBRARY_NAME) {
- partsLibraryName = partLibraryName;
- } else if (partsLibraryName != partLibraryName) {
- partsLibraryName = null;
- }
- } else if (libraryNameNode.name != partLibraryName) {
- errors.add(new AnalysisError(librarySource, partUri.offset,
- partUri.length, StaticWarningCode.PART_OF_DIFFERENT_LIBRARY, [
- libraryNameNode.name,
- partLibraryName
- ]));
+ hasPartDirective = true;
+ CompilationUnit partUnit = partUnitMap[partSource];
+ CompilationUnitElementImpl partElement = partUnit.element;
+ partElement.uriOffset = partUri.offset;
+ partElement.uriEnd = partUri.end;
+ partElement.uri = partDirective.uriContent;
+ //
+ // Validate that the part contains a part-of directive with the same
+ // name as the library.
+ //
+ String partLibraryName =
+ _getPartLibraryName(partSource, partUnit, directivesToResolve);
+ if (partLibraryName == null) {
+ errors.add(new AnalysisError(librarySource, partUri.offset,
+ partUri.length, CompileTimeErrorCode.PART_OF_NON_PART,
+ [partUri.toSource()]));
+ } else if (libraryNameNode == null) {
+ if (partsLibraryName == _UNKNOWN_LIBRARY_NAME) {
+ partsLibraryName = partLibraryName;
+ } else if (partsLibraryName != partLibraryName) {
+ partsLibraryName = null;
}
- if (entryPoint == null) {
- entryPoint = _findEntryPoint(partElement);
- }
- directive.element = partElement;
- sourcedCompilationUnits.add(partElement);
+ } else if (libraryNameNode.name != partLibraryName) {
+ errors.add(new AnalysisError(librarySource, partUri.offset,
+ partUri.length, StaticWarningCode.PART_OF_DIFFERENT_LIBRARY, [
+ libraryNameNode.name,
+ partLibraryName
+ ]));
+ }
+ if (entryPoint == null) {
+ entryPoint = _findEntryPoint(partElement);
}
+ directive.element = partElement;
+ sourcedCompilationUnits.add(partElement);
}
}
if (hasPartDirective && libraryNameNode == null) {
« no previous file with comments | « pkg/analyzer/lib/src/context/context.dart ('k') | pkg/analyzer/lib/src/task/general.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698