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

Unified Diff: pkg/compiler/lib/src/js_emitter/program_builder.dart

Issue 916413002: dart2js: register holder of constant in initial value of a static field. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698