Chromium Code Reviews| 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:async'; | 7 import 'dart:async'; |
| 8 import 'dart:io'; | 8 import 'dart:io'; |
| 9 import 'dart:uri'; | 9 import 'dart:uri'; |
| 10 import 'dart:utf'; | 10 import 'dart:utf'; |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 193 if (arguments.length > 1) { | 193 if (arguments.length > 1) { |
| 194 var extra = arguments.getRange(1, arguments.length - 1); | 194 var extra = arguments.getRange(1, arguments.length - 1); |
| 195 helpAndFail('Error: Extra arguments: ${Strings.join(extra, " ")}'); | 195 helpAndFail('Error: Extra arguments: ${Strings.join(extra, " ")}'); |
| 196 } | 196 } |
| 197 | 197 |
| 198 Map<String, SourceFile> sourceFiles = <String, SourceFile>{}; | 198 Map<String, SourceFile> sourceFiles = <String, SourceFile>{}; |
| 199 int dartBytesRead = 0; | 199 int dartBytesRead = 0; |
| 200 | 200 |
| 201 Future<String> provider(Uri uri) { | 201 Future<String> provider(Uri uri) { |
| 202 if (uri.scheme != 'file') { | 202 if (uri.scheme != 'file') { |
| 203 throw new ArgumentError(uri); | 203 throw new ArgumentError("Invalid uri '$uri'"); |
|
ahe
2013/01/24 10:00:57
How about: "Unknown scheme in uri '$uri'"
Johnni Winther
2013/01/24 13:04:59
Done.
| |
| 204 } | 204 } |
| 205 String source; | 205 String source; |
| 206 try { | 206 try { |
| 207 source = readAll(uriPathToNative(uri.path)); | 207 source = readAll(uriPathToNative(uri.path)); |
| 208 } on FileIOException catch (ex) { | 208 } on FileIOException catch (ex) { |
| 209 throw 'Error: Cannot read "${relativize(cwd, uri, isWindows)}" ' | 209 throw 'Error: Cannot read "${relativize(cwd, uri, isWindows)}" ' |
| 210 '(${ex.osError}).'; | 210 '(${ex.osError}).'; |
| 211 } | 211 } |
| 212 dartBytesRead += source.length; | 212 dartBytesRead += source.length; |
| 213 sourceFiles[uri.toString()] = | 213 sourceFiles[uri.toString()] = |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 466 } catch (ignored) { | 466 } catch (ignored) { |
| 467 print('Internal error: error while printing exception'); | 467 print('Internal error: error while printing exception'); |
| 468 } | 468 } |
| 469 try { | 469 try { |
| 470 print(trace); | 470 print(trace); |
| 471 } finally { | 471 } finally { |
| 472 exit(253); // 253 is recognized as a crash by our test scripts. | 472 exit(253); // 253 is recognized as a crash by our test scripts. |
| 473 } | 473 } |
| 474 } | 474 } |
| 475 } | 475 } |
| OLD | NEW |