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

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

Issue 1332223005: Handle deferred import without prefix. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/deferred_load.dart
diff --git a/pkg/compiler/lib/src/deferred_load.dart b/pkg/compiler/lib/src/deferred_load.dart
index c8056a2fc3b9c722f5b68eecb18bf61696b36ad2..949a37bde7fba0308f626736bb914056fe73a636 100644
--- a/pkg/compiler/lib/src/deferred_load.dart
+++ b/pkg/compiler/lib/src/deferred_load.dart
@@ -909,7 +909,13 @@ class _DeclaredDeferredImport implements _DeferredImport {
String computeImportDeferName(Compiler compiler) {
String result;
if (declaration.isDeferred) {
- result = declaration.prefix.name;
+ if (declaration.prefix != null) {
+ result = declaration.prefix.name;
+ } else {
+ // This happens when the deferred import isn't declared with a prefix.
+ assert(compiler.compilationFailed);
+ result = '';
+ }
} else {
// Finds the first argument to the [DeferredLibrary] annotation
List<MetadataAnnotation> metadatas = declaration.metadata;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698