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

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

Issue 694353007: 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: sdk/lib/_internal/compiler/implementation/js_emitter/class_stub_generator.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_emitter/class_stub_generator.dart b/sdk/lib/_internal/compiler/implementation/js_emitter/class_stub_generator.dart
deleted file mode 100644
index f2f48ca0ab1a52c61c1983a1025ddbb19a3308eb..0000000000000000000000000000000000000000
--- a/sdk/lib/_internal/compiler/implementation/js_emitter/class_stub_generator.dart
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright (c) 2014, 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;
-
-class ClassStubGenerator {
- final Namer namer;
- final Compiler compiler;
- final JavaScriptBackend backend;
-
- ClassStubGenerator(this.compiler, this.namer, this.backend);
-
- jsAst.Expression generateClassConstructor(ClassElement classElement,
- Iterable<String> fields) {
- // TODO(sra): Implement placeholders in VariableDeclaration position:
- //
- // String constructorName = namer.getNameOfClass(classElement);
- // return js.statement('function #(#) { #; }',
- // [ constructorName, fields,
- // fields.map(
- // (name) => js('this.# = #', [name, name]))]));
- return js('function(#) { #; }',
- [fields,
- fields.map((name) => js('this.# = #', [name, name]))]);
- }
-
- jsAst.Expression generateGetter(Element member, String fieldName) {
- ClassElement cls = member.enclosingClass;
- String receiver = backend.isInterceptorClass(cls) ? 'receiver' : 'this';
- List<String> args = backend.isInterceptedMethod(member) ? ['receiver'] : [];
- return js('function(#) { return #.# }', [args, receiver, fieldName]);
- }
-
- jsAst.Expression generateSetter(Element member, String fieldName) {
- ClassElement cls = member.enclosingClass;
- String receiver = backend.isInterceptorClass(cls) ? 'receiver' : 'this';
- List<String> args = backend.isInterceptedMethod(member) ? ['receiver'] : [];
- // TODO(floitsch): remove 'return'?
- return js('function(#, v) { return #.# = v; }',
- [args, receiver, fieldName]);
- }
-}

Powered by Google App Engine
This is Rietveld 408576698