| 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 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 isAborting = true; | 232 isAborting = true; |
| 233 throw new AbortLeg(message); | 233 throw new AbortLeg(message); |
| 234 } | 234 } |
| 235 } | 235 } |
| 236 | 236 |
| 237 Uri uri = cwd.resolve(arguments[0]); | 237 Uri uri = cwd.resolve(arguments[0]); |
| 238 if (packageRoot === null) { | 238 if (packageRoot === null) { |
| 239 packageRoot = uri.resolve('./packages/'); | 239 packageRoot = uri.resolve('./packages/'); |
| 240 } | 240 } |
| 241 | 241 |
| 242 info('compiling $uri'); | |
| 243 info('package root is $packageRoot'); | 242 info('package root is $packageRoot'); |
| 244 | 243 |
| 245 // TODO(ahe): We expect the future to be complete and call value | 244 // TODO(ahe): We expect the future to be complete and call value |
| 246 // directly. In effect, we don't support truly asynchronous API. | 245 // directly. In effect, we don't support truly asynchronous API. |
| 247 String code = api.compile(uri, libraryRoot, packageRoot, provider, handler, | 246 String code = api.compile(uri, libraryRoot, packageRoot, provider, handler, |
| 248 options).value; | 247 options).value; |
| 249 if (code === null) { | 248 if (code === null) { |
| 250 fail('Error: Compilation failed.'); | 249 fail('Error: Compilation failed.'); |
| 251 } | 250 } |
| 252 writeString(out, code); | 251 writeString(out, code); |
| (...skipping 131 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 |