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

Unified Diff: pkg/analyzer/lib/src/dart/element/builder.dart

Issue 1743523003: Clear the element for imports and exports when the target doesn't exist. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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/generated/compile_time_error_code_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/element/builder.dart
diff --git a/pkg/analyzer/lib/src/dart/element/builder.dart b/pkg/analyzer/lib/src/dart/element/builder.dart
index 39311d18b5e289c2d9b1724e44cb292965feb92c..48a732f47f28750b162918c7ed26b80c17cff89c 100644
--- a/pkg/analyzer/lib/src/dart/element/builder.dart
+++ b/pkg/analyzer/lib/src/dart/element/builder.dart
@@ -160,6 +160,8 @@ class DirectiveElementBuilder extends SimpleAstVisitor<Object> {
@override
Object visitExportDirective(ExportDirective node) {
+ // Remove previous element. (It will remain null if the target is missing.)
+ node.element = null;
Brian Wilkerson 2016/02/27 18:05:21 I don't understand why this would be necessary. Di
Source exportedSource = node.source;
if (exportedSource != null && context.exists(exportedSource)) {
// The exported source will be null if the URI in the export
@@ -200,6 +202,9 @@ class DirectiveElementBuilder extends SimpleAstVisitor<Object> {
@override
Object visitImportDirective(ImportDirective node) {
+ // Remove previous element. (It will remain null if the target is missing.)
+ node.element = null;
+
String uriContent = node.uriContent;
if (DartUriResolver.isDartExtUri(uriContent)) {
libraryElement.hasExtUri = true;
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/compile_time_error_code_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698