| 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 library test.kernel.closures.suite; | 5 library test.kernel.closures.suite; |
| 6 | 6 |
| 7 import 'dart:async' show Future; | 7 import 'dart:async' show Future; |
| 8 | 8 |
| 9 import 'dart:io' show Directory, File, Platform; | 9 import 'dart:io' show Directory, File, Platform; |
| 10 | 10 |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 try { | 141 try { |
| 142 DartLoader loader = await testContext.createLoader(); | 142 DartLoader loader = await testContext.createLoader(); |
| 143 Target target = getTarget( | 143 Target target = getTarget( |
| 144 "vm", new TargetFlags(strongMode: testContext.options.strongMode)); | 144 "vm", new TargetFlags(strongMode: testContext.options.strongMode)); |
| 145 String path = description.file.path; | 145 String path = description.file.path; |
| 146 Uri uri = Uri.base.resolve(path); | 146 Uri uri = Uri.base.resolve(path); |
| 147 Program program = loader.loadProgram(uri, target: target); | 147 Program program = loader.loadProgram(uri, target: target); |
| 148 for (var error in loader.errors) { | 148 for (var error in loader.errors) { |
| 149 return fail(program, "$error"); | 149 return fail(program, "$error"); |
| 150 } | 150 } |
| 151 target.transformProgram(program); | 151 target |
| 152 ..performModularTransformations(program) |
| 153 ..performGlobalTransformations(program); |
| 152 return pass(program); | 154 return pass(program); |
| 153 } catch (e, s) { | 155 } catch (e, s) { |
| 154 return crash(e, s); | 156 return crash(e, s); |
| 155 } | 157 } |
| 156 } | 158 } |
| 157 } | 159 } |
| 158 | 160 |
| 159 class ClosureConversion extends Step<Program, Program, TestContext> { | 161 class ClosureConversion extends Step<Program, Program, TestContext> { |
| 160 const ClosureConversion(); | 162 const ClosureConversion(); |
| 161 | 163 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 184 .run(context.vm.toFilePath(), [generated.path, "Hello, World!"]); | 186 .run(context.vm.toFilePath(), [generated.path, "Hello, World!"]); |
| 185 print(process.output); | 187 print(process.output); |
| 186 } finally { | 188 } finally { |
| 187 generated.parent.delete(recursive: true); | 189 generated.parent.delete(recursive: true); |
| 188 } | 190 } |
| 189 return process.toResult(); | 191 return process.toResult(); |
| 190 } | 192 } |
| 191 } | 193 } |
| 192 | 194 |
| 193 main(List<String> arguments) => runMe(arguments, createContext, "testing.json"); | 195 main(List<String> arguments) => runMe(arguments, createContext, "testing.json"); |
| OLD | NEW |