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

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

Issue 764533002: Incremental compiler: Use addStubs for adding methods. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Merged with r42040. Created 6 years 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 | dart/pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
-
}
« no previous file with comments | « no previous file | dart/pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698