| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
| 4 | 4 |
| 5 // TODO(ahe): Copied from closure_conversion branch of kernel, remove this file | 5 // TODO(ahe): Copied from closure_conversion branch of kernel, remove this file |
| 6 // when closure_conversion is merged with master. | 6 // when closure_conversion is merged with master. |
| 7 | 7 |
| 8 library kernel.testing.kernel_chain; | 8 library kernel.testing.kernel_chain; |
| 9 | 9 |
| 10 import 'dart:async' show | 10 import 'dart:async' show |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 TestDescription description, TestContext testContext) async { | 176 TestDescription description, TestContext testContext) async { |
| 177 try { | 177 try { |
| 178 DartLoader loader = await testContext.createLoader(); | 178 DartLoader loader = await testContext.createLoader(); |
| 179 Target target = getTarget( | 179 Target target = getTarget( |
| 180 "vm", new TargetFlags(strongMode: testContext.options.strongMode)); | 180 "vm", new TargetFlags(strongMode: testContext.options.strongMode)); |
| 181 Program program = | 181 Program program = |
| 182 loader.loadProgram(description.uri, target: target); | 182 loader.loadProgram(description.uri, target: target); |
| 183 for (var error in loader.errors) { | 183 for (var error in loader.errors) { |
| 184 return fail(program, "$error"); | 184 return fail(program, "$error"); |
| 185 } | 185 } |
| 186 target.transformProgram(program); | 186 target.performModularTransformations(program); |
| 187 target.performGlobalTransformations(program); |
| 187 return pass(program); | 188 return pass(program); |
| 188 } catch (e, s) { | 189 } catch (e, s) { |
| 189 return crash(e, s); | 190 return crash(e, s); |
| 190 } | 191 } |
| 191 } | 192 } |
| 192 } | 193 } |
| 193 | 194 |
| 194 | 195 |
| 195 class Print extends Step<Program, Program, dynamic> { | 196 class Print extends Step<Program, Program, dynamic> { |
| 196 const Print(); | 197 const Print(); |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 | 386 |
| 386 Future openWrite(Uri uri, f(IOSink sink)) async { | 387 Future openWrite(Uri uri, f(IOSink sink)) async { |
| 387 IOSink sink = new File.fromUri(uri).openWrite(); | 388 IOSink sink = new File.fromUri(uri).openWrite(); |
| 388 try { | 389 try { |
| 389 await f(sink); | 390 await f(sink); |
| 390 } finally { | 391 } finally { |
| 391 await sink.close(); | 392 await sink.close(); |
| 392 } | 393 } |
| 393 print("Wrote $uri"); | 394 print("Wrote $uri"); |
| 394 } | 395 } |
| OLD | NEW |