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

Unified Diff: pkg/fletchc/lib/src/fletch_compiler_hack.dart

Issue 918613002: Refactor implementation to address review comments and API design suggestions from Luke. (Closed) Base URL: git@github.com:dart-lang/fletch.git@master
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
Index: pkg/fletchc/lib/src/fletch_compiler_hack.dart
diff --git a/pkg/fletchc/lib/src/fletch_compiler_hack.dart b/pkg/fletchc/lib/src/fletch_compiler_hack.dart
new file mode 100644
index 0000000000000000000000000000000000000000..ad79671e69e1e66946dcc71ac49d3a1d9a58ab9b
--- /dev/null
+++ b/pkg/fletchc/lib/src/fletch_compiler_hack.dart
@@ -0,0 +1,33 @@
+// Copyright (c) 2015, the Fletch 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.md file.
+
+part of fletchc.fletch_compiler;
+
+abstract class FletchCompilerHack extends apiimpl.Compiler {
+ FletchCompilerHack(
+ api.CompilerInputProvider provider,
+ api.CompilerOutputProvider outputProvider,
+ api.DiagnosticHandler handler,
+ Uri libraryRoot,
+ Uri packageRoot,
+ List<String> options,
+ Map<String, dynamic> environment)
+ : super(provider, outputProvider, handler, libraryRoot, packageRoot,
+ options, environment) {
+ switchBackendHack();
+ }
+
+ void switchBackendHack() {
+ // TODO(ahe): Modify dart2js to support a custom backend directly, and
+ // remove this method.
+ int backendTaskCount = backend.tasks.length;
+ int apiimplTaskCount = 2;
+ int baseTaskCount = tasks.length - backendTaskCount - apiimplTaskCount;
+
+ tasks.removeRange(baseTaskCount, baseTaskCount + backendTaskCount);
+
+ backend = new FletchBackend(this);
+ tasks.addAll(backend.tasks);
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698