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

Unified Diff: pkg/compiler/lib/src/js_emitter/old_emitter/class_emitter.dart

Issue 828083003: dart2js: Don't assume fields are needed, if they are static. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 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/old_emitter/class_emitter.dart
diff --git a/pkg/compiler/lib/src/js_emitter/old_emitter/class_emitter.dart b/pkg/compiler/lib/src/js_emitter/old_emitter/class_emitter.dart
index d593fae74e1b6c85f9cd16475555ec19707e1f3f..98a9902c75e049b4a350067ff2ffb50296d53666 100644
--- a/pkg/compiler/lib/src/js_emitter/old_emitter/class_emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/old_emitter/class_emitter.dart
@@ -125,7 +125,8 @@ class ClassEmitter extends CodeEmitterHelper {
// generate the constructor. For native classes there are no
// constructors, so we don't need the fields unless we are generating
// accessors at runtime.
- if (!classIsNative || needsAccessor) {
+ bool needsFieldsForConstructor = !emitStatics && !classIsNative;
+ if (needsFieldsForConstructor || needsAccessor) {
var metadata = emitter.metadataEmitter.buildMetadataFunction(field);
if (metadata != null) {
hasMetadata = true;
« 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