| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #library('dart2js'); | 5 #library('dart2js'); |
| 6 | 6 |
| 7 #import('dart:io'); | 7 #import('dart:io'); |
| 8 #import('dart:uri'); | 8 #import('dart:uri'); |
| 9 #import('dart:utf'); | 9 #import('dart:utf'); |
| 10 | 10 |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 if (wantHelp) helpAndExit(verbose); | 144 if (wantHelp) helpAndExit(verbose); |
| 145 | 145 |
| 146 if (arguments.isEmpty()) { | 146 if (arguments.isEmpty()) { |
| 147 helpAndFail('Error: No Dart file specified.'); | 147 helpAndFail('Error: No Dart file specified.'); |
| 148 } | 148 } |
| 149 if (arguments.length > 1) { | 149 if (arguments.length > 1) { |
| 150 var extra = arguments.getRange(1, arguments.length - 1); | 150 var extra = arguments.getRange(1, arguments.length - 1); |
| 151 helpAndFail('Error: Extra arguments: ${Strings.join(extra, " ")}'); | 151 helpAndFail('Error: Extra arguments: ${Strings.join(extra, " ")}'); |
| 152 } | 152 } |
| 153 | 153 |
| 154 Map<String, SourceFile> sourceFiles = <SourceFile>{}; | 154 Map<String, SourceFile> sourceFiles = <String, SourceFile>{}; |
| 155 int dartBytesRead = 0; | 155 int dartBytesRead = 0; |
| 156 | 156 |
| 157 Future<String> provider(Uri uri) { | 157 Future<String> provider(Uri uri) { |
| 158 if (uri.scheme != 'file') { | 158 if (uri.scheme != 'file') { |
| 159 throw new IllegalArgumentException(uri); | 159 throw new IllegalArgumentException(uri); |
| 160 } | 160 } |
| 161 String source; | 161 String source; |
| 162 try { | 162 try { |
| 163 source = readAll(uriPathToNative(uri.path)); | 163 source = readAll(uriPathToNative(uri.path)); |
| 164 } catch (FileIOException ex) { | 164 } catch (FileIOException ex) { |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 } catch (var ignored) { | 374 } catch (var ignored) { |
| 375 print('Internal error: error while printing exception'); | 375 print('Internal error: error while printing exception'); |
| 376 } | 376 } |
| 377 try { | 377 try { |
| 378 print(trace); | 378 print(trace); |
| 379 } finally { | 379 } finally { |
| 380 exit(253); // 253 is recognized as a crash by our test scripts. | 380 exit(253); // 253 is recognized as a crash by our test scripts. |
| 381 } | 381 } |
| 382 } | 382 } |
| 383 } | 383 } |
| OLD | NEW |