Index: dart/pkg/compiler/lib/src/js_emitter/old_emitter/class_builder.dart |
diff --git a/dart/pkg/compiler/lib/src/js_emitter/old_emitter/class_builder.dart b/dart/pkg/compiler/lib/src/js_emitter/old_emitter/class_builder.dart |
index deb4fc44ba18ce9d2125fa356e1766b665ec58c4..c4b82d6a75c02f577fd2c912e5e19a4205d41f1e 100644 |
--- a/dart/pkg/compiler/lib/src/js_emitter/old_emitter/class_builder.dart |
+++ b/dart/pkg/compiler/lib/src/js_emitter/old_emitter/class_builder.dart |
@@ -34,7 +34,8 @@ class ClassBuilder { |
fields.add(field); |
} |
- jsAst.ObjectInitializer toObjectInitializer() { |
+ jsAst.ObjectInitializer toObjectInitializer( |
+ {bool omitClassDescriptor: false}) { |
StringBuffer buffer = new StringBuffer(); |
if (superName != null) { |
buffer.write('$superName'); |
@@ -52,11 +53,17 @@ class ClassBuilder { |
classData = |
new jsAst.ArrayInitializer.from([classData]..addAll(fieldMetadata)); |
} |
- var fieldsAndProperties = |
- [new jsAst.Property(js.string(namer.classDescriptorProperty), |
- classData)] |
- ..addAll(properties); |
+ List<jsAst.Property> fieldsAndProperties; |
+ if (!omitClassDescriptor) { |
+ fieldsAndProperties = <jsAst.Property>[]; |
+ fieldsAndProperties.add( |
+ new jsAst.Property( |
+ js.string(namer.classDescriptorProperty), classData)); |
+ fieldsAndProperties |
+ ..addAll(properties); |
+ } else { |
+ fieldsAndProperties = properties; |
+ } |
return new jsAst.ObjectInitializer(fieldsAndProperties, isOneLiner: false); |
} |
- |
} |