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 92116b8f77d792fd51a4a55ad9c908c99ccb6a0d..2f0a82c03d64aeecb78214d97c57ec47f5c0fe3b 100644 |
--- a/pkg/compiler/lib/src/deferred_load.dart |
+++ b/pkg/compiler/lib/src/deferred_load.dart |
@@ -286,8 +286,13 @@ class DeferredLoadTask extends CompilerTask { |
} |
treeElements.forEachConstantNode((Node node, _) { |
// Explicitly depend on the backend constants. |
- constants.add( |
- backend.constants.getConstantValueForNode(node, treeElements)); |
+ ConstantValue value = |
+ backend.constants.getConstantValueForNode(node, treeElements); |
+ if (value != null) { |
+ // TODO(johnniwinther): Assert that all constants have values when |
+ // these are directly evaluated. |
+ constants.add(value); |
+ } |
}); |
elements.addAll(treeElements.otherDependencies); |
} |