| 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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 } else if (kind === api.Diagnostic.INFO) { | 219 } else if (kind === api.Diagnostic.INFO) { |
| 220 color = colors.green; | 220 color = colors.green; |
| 221 } else { | 221 } else { |
| 222 throw 'Unknown kind: $kind (${kind.ordinal})'; | 222 throw 'Unknown kind: $kind (${kind.ordinal})'; |
| 223 } | 223 } |
| 224 if (uri === null) { | 224 if (uri === null) { |
| 225 assert(fatal); | 225 assert(fatal); |
| 226 print(color(message)); | 226 print(color(message)); |
| 227 } else if (fatal || showWarnings) { | 227 } else if (fatal || showWarnings) { |
| 228 SourceFile file = sourceFiles[uri.toString()]; | 228 SourceFile file = sourceFiles[uri.toString()]; |
| 229 print(file.getLocationMessage(color(message), begin, end, true, | 229 print(file.getLocationMessage(color(message), begin, end, true, color)); |
| 230 color)); | |
| 231 } | 230 } |
| 232 if (fatal && throwOnError) { | 231 if (fatal && throwOnError) { |
| 233 isAborting = true; | 232 isAborting = true; |
| 234 throw new AbortLeg(message); | 233 throw new AbortLeg(message); |
| 235 } | 234 } |
| 236 } | 235 } |
| 237 | 236 |
| 238 Uri uri = cwd.resolve(arguments[0]); | 237 Uri uri = cwd.resolve(arguments[0]); |
| 239 if (packageRoot === null) { | 238 if (packageRoot === null) { |
| 240 packageRoot = uri.resolve('./packages/'); | 239 packageRoot = uri.resolve('./packages/'); |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 384 } catch (ignored) { | 383 } catch (ignored) { |
| 385 print('Internal error: error while printing exception'); | 384 print('Internal error: error while printing exception'); |
| 386 } | 385 } |
| 387 try { | 386 try { |
| 388 print(trace); | 387 print(trace); |
| 389 } finally { | 388 } finally { |
| 390 exit(253); // 253 is recognized as a crash by our test scripts. | 389 exit(253); // 253 is recognized as a crash by our test scripts. |
| 391 } | 390 } |
| 392 } | 391 } |
| 393 } | 392 } |
| OLD | NEW |