| 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 } | 126 } |
| 127 String source; | 127 String source; |
| 128 try { | 128 try { |
| 129 source = readAll(uriPathToNative(uri.path)); | 129 source = readAll(uriPathToNative(uri.path)); |
| 130 } catch (FileIOException ex) { | 130 } catch (FileIOException ex) { |
| 131 throw 'Error: Cannot read "${relativize(cwd, uri)}" (${ex.osError}).'; | 131 throw 'Error: Cannot read "${relativize(cwd, uri)}" (${ex.osError}).'; |
| 132 } | 132 } |
| 133 dartBytesRead += source.length; | 133 dartBytesRead += source.length; |
| 134 sourceFiles[uri.toString()] = | 134 sourceFiles[uri.toString()] = |
| 135 new SourceFile(relativize(cwd, uri), source); | 135 new SourceFile(relativize(cwd, uri), source); |
| 136 Completer<String> completer = new Completer<String>(); | 136 return new Future.immediate(source); |
| 137 completer.complete(source); | |
| 138 return completer.future; | |
| 139 } | 137 } |
| 140 | 138 |
| 141 void info(var message) { | 139 void info(var message) { |
| 142 if (verbose) print('${colors.green("info:")} $message'); | 140 if (verbose) print('${colors.green("info:")} $message'); |
| 143 } | 141 } |
| 144 | 142 |
| 145 bool isAborting = false; | 143 bool isAborting = false; |
| 146 | 144 |
| 147 void handler(Uri uri, int begin, int end, String message, bool fatal) { | 145 void handler(Uri uri, int begin, int end, String message, bool fatal) { |
| 148 if (isAborting) return; | 146 if (isAborting) return; |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 } catch (var ignored) { | 307 } catch (var ignored) { |
| 310 print('Internal error: error while printing exception'); | 308 print('Internal error: error while printing exception'); |
| 311 } | 309 } |
| 312 try { | 310 try { |
| 313 print(trace); | 311 print(trace); |
| 314 } finally { | 312 } finally { |
| 315 exit(253); // 253 is recognized as a crash by our test scripts. | 313 exit(253); // 253 is recognized as a crash by our test scripts. |
| 316 } | 314 } |
| 317 } | 315 } |
| 318 } | 316 } |
| OLD | NEW |