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

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

Issue 1973753004: Change dart2js.dart to use compiler_new.dart (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 4 years, 7 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 | « no previous file | pkg/compiler/lib/src/source_file_provider.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/dart2js.dart
diff --git a/pkg/compiler/lib/src/dart2js.dart b/pkg/compiler/lib/src/dart2js.dart
index 336dfc6f59ad3f416e7b1e6cb8ef5950ca544b4a..ee9e612ee969aaaed603ec86f5b9edda50248552 100644
--- a/pkg/compiler/lib/src/dart2js.dart
+++ b/pkg/compiler/lib/src/dart2js.dart
@@ -10,10 +10,11 @@ import 'dart:io' show exit, File, FileMode, Platform, stdin, stderr;
import 'package:package_config/discovery.dart' show findPackages;
-import '../compiler.dart' as api;
+import '../compiler_new.dart' as api;
import 'commandline_options.dart';
import 'filenames.dart';
import 'io/source_file.dart';
+import 'options.dart' show CompilerOptions;
import 'source_file_provider.dart';
import 'util/command_line.dart';
import 'util/uri_extras.dart';
@@ -484,18 +485,17 @@ Future<api.CompilationResult> compile(List<String> argv) {
return result;
}
- Uri uri = currentDirectory.resolve(arguments[0]);
- return compileFunc(
- uri,
- libraryRoot,
- packageRoot,
- inputProvider,
- diagnosticHandler,
- options,
- outputProvider,
- environment,
- packageConfig,
- findPackages)
+ Uri script = currentDirectory.resolve(arguments[0]);
+ CompilerOptions compilerOptions = new CompilerOptions.parse(
+ entryPoint: script,
+ libraryRoot: libraryRoot,
+ packageRoot: packageRoot,
+ packageConfig: packageConfig,
+ packagesDiscoveryProvider: findPackages,
+ options: options,
+ environment: environment);
+ return compileFunc(compilerOptions, inputProvider,
+ diagnosticHandler, outputProvider)
.then(compilationDone);
}
@@ -706,8 +706,15 @@ void main(List<String> arguments) {
internalMain(arguments);
}
-var exitFunc = exit;
-var compileFunc = api.compile;
+typedef void ExitFunc(int exitCode);
+typedef Future<api.CompilationResult> CompileFunc(
+ CompilerOptions compilerOptions,
+ api.CompilerInput compilerInput,
+ api.CompilerDiagnostics compilerDiagnostics,
+ api.CompilerOutput compilerOutput);
+
+ExitFunc exitFunc = exit;
+CompileFunc compileFunc = api.compile;
Future<api.CompilationResult> internalMain(List<String> arguments) {
Future onError(exception, trace) {
« no previous file with comments | « no previous file | pkg/compiler/lib/src/source_file_provider.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698