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

Unified Diff: sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.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/code_emitter_task.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart b/sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart
index 4f975e2ad6fe748395d9afbb3fe0b24cbc3b2f75..6719f8d9b32a85f9b686713d789c48d4f6c10b65 100644
--- a/sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart
@@ -331,12 +331,13 @@ class CodeEmitterTask extends CompilerTask {
* string encoding fields, constructor and superclass. Get
* the superclass and the fields in the format
* '[name/]Super;field1,field2'
- * from the null-string property on the descriptor.
+ * from the CLASS_DESCRIPTOR_PROPERTY property on the descriptor.
* The 'name/' is optional and contains the name that should be used
* when printing the runtime type string. It is used, for example, to
* print the runtime type JSInt as 'int'.
*/
- js('var classData = desc[""], supr, name = cls, fields = classData'),
+ js('var classData = desc["${namer.classDescriptorProperty}"], '
+ 'supr, name = cls, fields = classData'),
optional(
backend.hasRetainedMetadata,
js.if_('typeof classData == "object" && '
@@ -828,7 +829,7 @@ class CodeEmitterTask extends CompilerTask {
backend.generatedCode.keys.where(isStaticFunction);
for (Element element in Elements.sortedByPosition(elements)) {
- ClassBuilder builder = new ClassBuilder();
+ ClassBuilder builder = new ClassBuilder(namer);
containerBuilder.addMember(element, builder);
getElementDecriptor(element).properties.addAll(builder.properties);
}
@@ -1350,7 +1351,7 @@ mainBuffer.add(r'''
// not see libraries that only have fields.
if (element.isLibrary()) {
LibraryElement library = element;
- ClassBuilder builder = new ClassBuilder();
+ ClassBuilder builder = new ClassBuilder(namer);
if (classEmitter.emitFields(
library, builder, null, emitStatics: true)) {
OutputUnit mainUnit = compiler.deferredLoadTask.mainOutputUnit;
@@ -1548,7 +1549,7 @@ if (typeof $printHelperName === "function") {
elementDescriptors.putIfAbsent(
element, () => new Map<OutputUnit, ClassBuilder>());
return descriptors.putIfAbsent(outputUnit,
- () => new ClassBuilder());
+ () => new ClassBuilder(namer));
}
ClassBuilder getElementDecriptor(Element element) {

Powered by Google App Engine
This is Rietveld 408576698