Index: pkg/compiler/lib/src/constants/expressions.dart |
diff --git a/pkg/compiler/lib/src/constants/expressions.dart b/pkg/compiler/lib/src/constants/expressions.dart |
index 922ae068073ade58b01a79f842cda00232558377..a6317d5f9830ec8b4f83ca003228f7b309cf15c4 100644 |
--- a/pkg/compiler/lib/src/constants/expressions.dart |
+++ b/pkg/compiler/lib/src/constants/expressions.dart |
@@ -482,11 +482,20 @@ class MapConstantExpression extends ConstantExpression { |
@override |
ConstantValue evaluate( |
Environment environment, ConstantSystem constantSystem) { |
+ Map<ConstantValue, ConstantValue> valueMap = |
+ <ConstantValue, ConstantValue>{}; |
+ for (int index = 0; index < keys.length; index++) { |
+ ConstantValue key = |
+ keys[index].evaluate(environment, constantSystem); |
+ ConstantValue value = |
+ values[index].evaluate(environment, constantSystem); |
+ valueMap[key] = value; |
+ } |
return constantSystem.createMap( |
environment.compiler, |
type, |
- keys.map((k) => k.evaluate(environment, constantSystem)).toList(), |
- values.map((v) => v.evaluate(environment, constantSystem)).toList()); |
+ valueMap.keys.toList(), |
+ valueMap.values.toList()); |
} |
ConstantExpression apply(NormalizedArguments arguments) { |