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

Unified Diff: sdk/lib/_internal/compiler/implementation/js_emitter/class_builder.dart

Issue 170103003: Avoid use of empty string as a property name. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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
Index: sdk/lib/_internal/compiler/implementation/js_emitter/class_builder.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_emitter/class_builder.dart b/sdk/lib/_internal/compiler/implementation/js_emitter/class_builder.dart
index 53e32d8de8789e56ec417f7c048f3eb78ac0bd1e..044368bb9d53833e27d581ce19ca2ef4a4096585 100644
--- a/sdk/lib/_internal/compiler/implementation/js_emitter/class_builder.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_emitter/class_builder.dart
@@ -16,9 +16,13 @@ class ClassBuilder {
String functionType;
List<jsAst.Node> fieldMetadata;
+ final Namer namer;
+
/// Set to true by user if class is indistinguishable from its superclass.
bool isTrivial = false;
+ ClassBuilder(this.namer);
+
// Has the same signature as [DefineStubFunction].
void addProperty(String name, jsAst.Expression value) {
properties.add(new jsAst.Property(js.string(name), value));
@@ -50,7 +54,8 @@ class ClassBuilder {
new jsAst.ArrayInitializer.from([classData]..addAll(fieldMetadata));
}
var fieldsAndProperties =
- [new jsAst.Property(js.string(''), classData)]
+ [new jsAst.Property(js.string(namer.classDescriptorProperty),
+ classData)]
..addAll(properties);
return new jsAst.ObjectInitializer(fieldsAndProperties, isOneLiner: false);
}

Powered by Google App Engine
This is Rietveld 408576698