Index: pkg/analyzer/lib/src/context/context.dart |
diff --git a/pkg/analyzer/lib/src/context/context.dart b/pkg/analyzer/lib/src/context/context.dart |
index 858fd0636a60235d799a0f331834c973c7a6e256..4993e19fefe368dfcd0452113222a3da572cd92c 100644 |
--- a/pkg/analyzer/lib/src/context/context.dart |
+++ b/pkg/analyzer/lib/src/context/context.dart |
@@ -1864,6 +1864,15 @@ class AnalysisContextImpl implements InternalAnalysisContext { |
builder.build(); |
CompilationUnitElementDelta unitDelta = builder.unitDelta; |
if (!unitDelta.hasDirectiveChange) { |
+ // Update constants. |
+ { |
+ ConstantFinder finder = |
+ new ConstantFinder(this, source, librarySource); |
+ oldUnit.accept(finder); |
+ unitEntry.setValueIncremental(COMPILATION_UNIT_CONSTANTS, |
+ finder.constantsToCompute.toList(), false); |
+ } |
+ // Build DartDelta. |
DartDelta dartDelta = new DartDelta(source); |
dartDelta.hasDirectiveChange = unitDelta.hasDirectiveChange; |
unitDelta.addedDeclarations.forEach(dartDelta.elementChanged); |