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

Unified Diff: sdk/lib/_internal/compiler/implementation/js_backend/emitter_no_eval.dart

Issue 11795002: Revert "Retry "Emit more stuff via ASTs"" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 12 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_backend/emitter_no_eval.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/emitter_no_eval.dart b/sdk/lib/_internal/compiler/implementation/js_backend/emitter_no_eval.dart
index ac5968b9029dec8f52907b1bb68105130b83fd70..6810dac58a35977f4427438c65ba11aea82a3fe2 100644
--- a/sdk/lib/_internal/compiler/implementation/js_backend/emitter_no_eval.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_backend/emitter_no_eval.dart
@@ -88,12 +88,14 @@ $lazyInitializerLogic
void emitBoundClosureClassHeader(String mangledName,
String superName,
List<String> fieldNames,
- ClassBuilder builder) {
- builder.addProperty('', buildConstructor(mangledName, fieldNames));
- builder.addProperty('super', js.string(superName));
+ CodeBuffer buffer) {
+ buffer.add("$classesCollector.$mangledName = {'': ");
+ buffer.add(
+ js.prettyPrint(buildConstructor(mangledName, fieldNames), compiler));
+ buffer.add(",\n 'super': '$superName',\n");
}
- void emitClassConstructor(ClassElement classElement, ClassBuilder builder) {
+ void emitClassConstructor(ClassElement classElement, CodeBuffer buffer) {
// Say we have a class A with fields b, c and d, where c needs a getter and
// d needs both a getter and a setter. Then we produce:
// - a constructor (directly into the given [buffer]):
@@ -112,20 +114,23 @@ $lazyInitializerLogic
fields.add(name);
});
String constructorName = namer.safeName(classElement.name.slowToString());
-
- builder.addProperty('', buildConstructor(constructorName, fields));
+ buffer.add("'': ");
+ buffer.add(
+ js.prettyPrint(buildConstructor(constructorName, fields), compiler));
}
- void emitSuper(String superName, ClassBuilder builder) {
+ void emitSuper(String superName, CodeBuffer buffer) {
if (superName != '') {
- builder.addProperty('super', js.string(superName));
+ buffer.add(",\n 'super': '$superName'");
}
}
void emitClassFields(ClassElement classElement,
- ClassBuilder builder,
+ CodeBuffer buffer,
+ bool emitEndingComma,
{ String superClass: "",
bool classIsNative: false}) {
+ if (emitEndingComma) buffer.add(', ');
}
bool get getterAndSetterCanBeImplementedByFieldSpec => false;

Powered by Google App Engine
This is Rietveld 408576698