Index: pkg/compiler/lib/src/js_emitter/program_builder.dart |
diff --git a/pkg/compiler/lib/src/js_emitter/program_builder.dart b/pkg/compiler/lib/src/js_emitter/program_builder.dart |
index 7036bb73a526943aa7b76c7b6428ec600e21bedc..ce9adbaf99ae4a1a729658f71f5ceff49b552bbc 100644 |
--- a/pkg/compiler/lib/src/js_emitter/program_builder.dart |
+++ b/pkg/compiler/lib/src/js_emitter/program_builder.dart |
@@ -209,6 +209,9 @@ class ProgramBuilder { |
StaticField _buildStaticField(Element element) { |
JavaScriptConstantCompiler handler = backend.constants; |
ConstantValue initialValue = handler.getInitialValueFor(element).value; |
+ // TODO(zarah): The holder should not be registered during building of |
+ // a static field. |
+ _registry.registerHolder(namer.globalObjectForConstant(initialValue)); |
js.Expression code = _task.emitter.constantReference(initialValue); |
String name = namer.getNameOfGlobalField(element); |
bool isFinal = false; |