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

Unified Diff: pkg/compiler/lib/src/serialization/element_serialization.dart

Issue 1919143002: Store constant variable initializers in elements. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 4 years, 8 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 | « pkg/compiler/lib/src/resolution/resolution.dart ('k') | pkg/compiler/lib/src/serialization/modelz.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/serialization/element_serialization.dart
diff --git a/pkg/compiler/lib/src/serialization/element_serialization.dart b/pkg/compiler/lib/src/serialization/element_serialization.dart
index e3d1526e10a1c9046156e7efc0c35dd8a0dd0c3f..6f5dc4d83cd17ded8f670874a3d2e135d65114b3 100644
--- a/pkg/compiler/lib/src/serialization/element_serialization.dart
+++ b/pkg/compiler/lib/src/serialization/element_serialization.dart
@@ -398,8 +398,8 @@ class FieldSerializer implements ElementSerializer {
encoder.setType(Key.TYPE, element.type);
encoder.setBool(Key.IS_FINAL, element.isFinal);
encoder.setBool(Key.IS_CONST, element.isConst);
- if (element.isConst) {
- ConstantExpression constant = element.constant;
+ ConstantExpression constant = element.constant;
+ if (constant != null) {
encoder.setConstant(Key.CONSTANT, constant);
}
SerializerUtil.serializeParentRelation(element, encoder);
« no previous file with comments | « pkg/compiler/lib/src/resolution/resolution.dart ('k') | pkg/compiler/lib/src/serialization/modelz.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698