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

Unified Diff: pkg/compiler/lib/src/compiler.dart

Issue 2116473002: Handle invalid deferred prefix declarations. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 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 | tests/compiler/dart2js/serialization/test_data.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/compiler.dart
diff --git a/pkg/compiler/lib/src/compiler.dart b/pkg/compiler/lib/src/compiler.dart
index 7c1d58e9bf1576bc7b20d64185d89e4765119d79..d567bbaed7ccc89da0e7b15c5ed6d35bc4ee817e 100644
--- a/pkg/compiler/lib/src/compiler.dart
+++ b/pkg/compiler/lib/src/compiler.dart
@@ -922,7 +922,12 @@ abstract class Compiler implements LibraryLoaderListener {
library.implementation.forEachLocalMember(enqueueAll);
library.imports.forEach((ImportElement import) {
if (import.isDeferred) {
- world.addToWorkList(import.prefix.loadLibrary);
+ // `import.prefix` and `loadLibrary` may be `null` when the deferred
+ // import has compile-time errors.
+ GetterElement loadLibrary = import.prefix?.loadLibrary;
+ if (loadLibrary != null) {
+ world.addToWorkList(loadLibrary);
+ }
}
});
}
« no previous file with comments | « no previous file | tests/compiler/dart2js/serialization/test_data.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698