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

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

Issue 832363002: Remove Compiler.assembledCode. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix unittest Created 5 years, 11 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/compiler.dart ('k') | pkg/compiler/lib/src/dart_backend/backend.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 0372b8534d60c2bfe79bd2d09d8f1a47507fb8f3..aa564ed74fd86d2b528149df6561938463e28e33 100644
--- a/pkg/compiler/lib/src/dart2js.dart
+++ b/pkg/compiler/lib/src/dart2js.dart
@@ -100,7 +100,7 @@ void parseCommandLine(List<OptionHandler> handlers, List<String> argv) {
FormattingDiagnosticHandler diagnosticHandler;
-Future compile(List<String> argv) {
+Future<api.CompilationResult> compile(List<String> argv) {
stackTraceFilePrefix = '$currentDirectory';
Uri libraryRoot = currentDirectory;
Uri out = currentDirectory.resolve('out.js');
@@ -422,9 +422,9 @@ Future compile(List<String> argv) {
new RandomAccessFileOutputProvider(
out, sourceMapOut, onInfo: diagnosticHandler.info, onFailure: fail);
- compilationDone(String code) {
- if (analyzeOnly) return;
- if (code == null) {
+ api.CompilationResult compilationDone(api.CompilationResult result) {
+ if (analyzeOnly) return result;
+ if (!result.isSuccess) {
fail('Compilation failed.');
}
writeString(Uri.parse('$out.deps'),
@@ -446,6 +446,7 @@ Future compile(List<String> argv) {
String output = relativize(currentDirectory, out, Platform.isWindows);
print('Dart file ($input) compiled to $outputLanguage: $output');
}
+ return result;
}
return compileFunc(uri, libraryRoot, packageRoot,
@@ -479,7 +480,7 @@ void fail(String message) {
exitFunc(1);
}
-Future compilerMain(List<String> arguments) {
+Future<api.CompilationResult> compilerMain(List<String> arguments) {
var root = uriPathToNative("/$LIBRARY_ROOT");
arguments = <String>['--library-root=${Platform.script.toFilePath()}$root']
..addAll(arguments);
@@ -642,8 +643,8 @@ void main(List<String> arguments) {
var exitFunc = exit;
var compileFunc = api.compile;
-Future internalMain(List<String> arguments) {
- onError(exception, trace) {
+Future<api.CompilationResult> internalMain(List<String> arguments) {
+ Future onError(exception, trace) {
try {
print('The compiler crashed: $exception');
} catch (ignored) {
@@ -657,13 +658,13 @@ Future internalMain(List<String> arguments) {
} finally {
exitFunc(253); // 253 is recognized as a crash by our test scripts.
}
+ return new Future.error(exception, trace);
}
try {
return compilerMain(arguments).catchError(onError);
} catch (exception, trace) {
- onError(exception, trace);
- return new Future.value();
+ return onError(exception, trace);
}
}
« no previous file with comments | « pkg/compiler/lib/src/compiler.dart ('k') | pkg/compiler/lib/src/dart_backend/backend.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698