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

Unified Diff: dart/lib/compiler/implementation/dart2js.dart

Issue 10257004: Turn dart2js into a shell script. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address review comments Created 8 years, 8 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 | dart/utils/compiler/build_helper.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/lib/compiler/implementation/dart2js.dart
diff --git a/dart/lib/compiler/implementation/dart2js.dart b/dart/lib/compiler/implementation/dart2js.dart
index 347b1bfdc15d5a65dcbb90a055ec09cd71ba0d70..63e477fb79abd620a4da8427c3d1c066b870ad56 100644
--- a/dart/lib/compiler/implementation/dart2js.dart
+++ b/dart/lib/compiler/implementation/dart2js.dart
@@ -14,6 +14,8 @@
#import('filenames.dart');
#import('util/uri_extras.dart');
+final String LIBRARY_ROOT = '../../../..';
+
void compile(List<String> argv) {
Uri cwd = getCurrentDirectory();
bool throwOnError = false;
@@ -134,3 +136,26 @@ void fail(String message) {
print(message);
exit(1);
}
+
+void compilerMain(Options options) {
+ List<String> argv = ['--library-root=${options.script}/$LIBRARY_ROOT'];
+ argv.addAll(options.arguments);
+ compile(argv);
+}
+
+void main() {
+ try {
+ compilerMain(new Options());
+ } catch (var exception, var trace) {
+ try {
+ print('Internal error: \$exception');
+ } catch (var ignored) {
+ print('Internal error: error while printing exception');
+ }
+ try {
+ print(trace);
+ } finally {
+ exit(253); // 253 is recognized as a crash by our test scripts.
+ }
+ }
+}
« no previous file with comments | « no previous file | dart/utils/compiler/build_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698