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

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

Issue 693183006: Revert "Move dart2js from sdk/lib/_internal/compiler to pkg/compiler" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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: pkg/compiler/lib/src/js_emitter/old_emitter/class_builder.dart
diff --git a/pkg/compiler/lib/src/js_emitter/old_emitter/class_builder.dart b/pkg/compiler/lib/src/js_emitter/old_emitter/class_builder.dart
deleted file mode 100644
index deb4fc44ba18ce9d2125fa356e1766b665ec58c4..0000000000000000000000000000000000000000
--- a/pkg/compiler/lib/src/js_emitter/old_emitter/class_builder.dart
+++ /dev/null
@@ -1,62 +0,0 @@
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-part of dart2js.js_emitter;
-
-/**
- * A data structure for collecting fragments of a class definition.
- */
-class ClassBuilder {
- final List<jsAst.Property> properties = <jsAst.Property>[];
- final List<String> fields = <String>[];
-
- String superName;
- String functionType;
- List<jsAst.Node> fieldMetadata;
-
- final Element element;
- final Namer namer;
-
- /// Set to true by user if class is indistinguishable from its superclass.
- bool isTrivial = false;
-
- ClassBuilder(this.element, this.namer);
-
- // Has the same signature as [DefineStubFunction].
- jsAst.Property addProperty(String name, jsAst.Expression value) {
- jsAst.Property property = new jsAst.Property(js.string(name), value);
- properties.add(property);
- return property;
- }
-
- void addField(String field) {
- fields.add(field);
- }
-
- jsAst.ObjectInitializer toObjectInitializer() {
- StringBuffer buffer = new StringBuffer();
- if (superName != null) {
- buffer.write('$superName');
- if (functionType != null) {
- buffer.write(':$functionType');
- }
- buffer.write(';');
- }
- buffer.writeAll(fields, ',');
- var classData = js.string('$buffer');
- if (fieldMetadata != null) {
- // If we need to store fieldMetadata, classData is turned into an array,
- // and the field metadata is appended. So if classData is just a string,
- // there is no field metadata.
- classData =
- new jsAst.ArrayInitializer.from([classData]..addAll(fieldMetadata));
- }
- var fieldsAndProperties =
- [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