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 2b0b7fc7882639f7f25ce9534caa4f05da44f05f..92116b8f77d792fd51a4a55ad9c908c99ccb6a0d 100644 |
--- a/pkg/compiler/lib/src/deferred_load.dart |
+++ b/pkg/compiler/lib/src/deferred_load.dart |
@@ -287,17 +287,17 @@ class DeferredLoadTask extends CompilerTask { |
treeElements.forEachConstantNode((Node node, _) { |
// Explicitly depend on the backend constants. |
constants.add( |
- backend.constants.getConstantForNode(node, treeElements).value); |
+ backend.constants.getConstantValueForNode(node, treeElements)); |
}); |
elements.addAll(treeElements.otherDependencies); |
} |
// TODO(sigurdm): How is metadata on a patch-class handled? |
for (MetadataAnnotation metadata in element.metadata) { |
- ConstantExpression constant = |
- backend.constants.getConstantForMetadata(metadata); |
+ ConstantValue constant = |
+ backend.constants.getConstantValueForMetadata(metadata); |
if (constant != null) { |
- constants.add(constant.value); |
+ constants.add(constant); |
} |
} |
@@ -491,20 +491,18 @@ class DeferredLoadTask extends CompilerTask { |
}); |
for (MetadataAnnotation metadata in library.metadata) { |
- ConstantExpression constant = |
- backend.constants.getConstantForMetadata(metadata); |
+ ConstantValue constant = |
+ backend.constants.getConstantValueForMetadata(metadata); |
if (constant != null) { |
- _mapConstantDependencies(constant.value, |
- deferredImport); |
+ _mapConstantDependencies(constant, deferredImport); |
} |
} |
for (LibraryTag tag in library.tags) { |
for (MetadataAnnotation metadata in tag.metadata) { |
- ConstantExpression constant = |
- backend.constants.getConstantForMetadata(metadata); |
+ ConstantValue constant = |
+ backend.constants.getConstantValueForMetadata(metadata); |
if (constant != null) { |
- _mapConstantDependencies(constant.value, |
- deferredImport); |
+ _mapConstantDependencies(constant, deferredImport); |
} |
} |
} |
@@ -537,10 +535,11 @@ class DeferredLoadTask extends CompilerTask { |
assert(metadatas != null); |
for (MetadataAnnotation metadata in metadatas) { |
metadata.ensureResolved(compiler); |
- Element element = |
- metadata.constant.value.getType(compiler.coreTypes).element; |
+ ConstantValue value = |
+ compiler.constants.getConstantValue(metadata.constant); |
+ Element element = value.getType(compiler.coreTypes).element; |
if (element == deferredLibraryClass) { |
- ConstructedConstantValue constant = metadata.constant.value; |
+ ConstructedConstantValue constant = value; |
StringConstantValue s = constant.fields.values.single; |
result = s.primitiveValue.slowToString(); |
break; |
@@ -727,8 +726,9 @@ class DeferredLoadTask extends CompilerTask { |
if (metadataList != null) { |
for (MetadataAnnotation metadata in metadataList) { |
metadata.ensureResolved(compiler); |
- Element element = |
- metadata.constant.value.getType(compiler.coreTypes).element; |
+ ConstantValue value = |
+ compiler.constants.getConstantValue(metadata.constant); |
+ Element element = value.getType(compiler.coreTypes).element; |
if (element == deferredLibraryClass) { |
compiler.reportError( |
import, MessageKind.DEFERRED_OLD_SYNTAX); |