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

Unified Diff: pkg/compiler/lib/src/js/js.dart

Issue 922463002: Revert "Redo "Steps towards making dart2js JS AST templates an indepentent library."" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 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
« no previous file with comments | « pkg/compiler/lib/src/js/characters.dart ('k') | pkg/compiler/lib/src/js/js_ast.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js/js.dart
diff --git a/pkg/compiler/lib/src/js/js.dart b/pkg/compiler/lib/src/js/js.dart
index a5bbec4244f1ea5c3ffa605e2a1c4010f1f6a322..fac460db21e1eb06b98edb6564ef455db4cc36a8 100644
--- a/pkg/compiler/lib/src/js/js.dart
+++ b/pkg/compiler/lib/src/js/js.dart
@@ -1,64 +1,23 @@
-// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// Copyright (c) 2012, 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.
library js;
-// TODO(sra): This will become a package import.
-import 'js_ast.dart';
-export 'js_ast.dart';
-
+import 'precedence.dart';
+import '../util/characters.dart' as charCodes;
+import '../util/util.dart';
import '../io/code_output.dart' show CodeBuffer;
import '../io/source_information.dart' show SourceInformation;
import '../js_emitter/js_emitter.dart' show USE_NEW_EMITTER;
-import '../dart2jslib.dart' as leg;
-import '../util/util.dart' show NO_LOCATION_SPANNABLE;
-import '../dump_info.dart' show DumpInfoTask;
-
-
-CodeBuffer prettyPrint(Node node, leg.Compiler compiler,
- {DumpInfoTask monitor,
- bool allowVariableMinification: true}) {
- JavaScriptPrintingOptions options = new JavaScriptPrintingOptions(
- shouldCompressOutput: compiler.enableMinification,
- minifyLocalVariables: allowVariableMinification,
- preferSemicolonToNewlineInMinifiedOutput: USE_NEW_EMITTER);
- Dart2JSJavaScriptPrintingContext context =
- new Dart2JSJavaScriptPrintingContext(compiler, monitor);
- Printer printer = new Printer(options, context);
- printer.visit(node);
- return context.outBuffer;
-}
-class Dart2JSJavaScriptPrintingContext implements JavaScriptPrintingContext {
- final leg.Compiler compiler;
- final DumpInfoTask monitor;
- final CodeBuffer outBuffer = new CodeBuffer();
-
- Dart2JSJavaScriptPrintingContext(leg.Compiler this.compiler,
- DumpInfoTask this.monitor);
-
- void error(String message) {
- compiler.internalError(NO_LOCATION_SPANNABLE, message);
- }
-
- void emit(String string) {
- outBuffer.add(string);
- }
+// TODO(floitsch): remove this dependency (currently necessary for the
+// CodeBuffer).
+import '../dart2jslib.dart' as leg;
- void enterNode(Node node) {
- SourceInformation sourceInformation = node.sourceInformation;
- if (sourceInformation != null) {
- sourceInformation.beginMapping(outBuffer);
- }
- if (monitor != null) monitor.enteringAst(node, outBuffer.length);
- }
+import '../dump_info.dart';
- void exitNode(Node node) {
- if (monitor != null) monitor.exitingAst(node, outBuffer.length);
- SourceInformation sourceInformation = node.sourceInformation;
- if (sourceInformation != null) {
- sourceInformation.endMapping(outBuffer);
- }
- }
-}
+part 'nodes.dart';
+part 'builder.dart';
+part 'printer.dart';
+part 'template.dart';
« no previous file with comments | « pkg/compiler/lib/src/js/characters.dart ('k') | pkg/compiler/lib/src/js/js_ast.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698