OLD | NEW |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 'package:front_end/physical_file_system.dart' show PhysicalFileSystem; | 9 import 'package:front_end/physical_file_system.dart' show PhysicalFileSystem; |
10 | 10 |
| 11 import 'package:kernel/core_types.dart' show CoreTypes; |
| 12 |
11 import 'package:testing/testing.dart' | 13 import 'package:testing/testing.dart' |
12 show Chain, ChainContext, Result, Step, TestDescription, runMe; | 14 show Chain, ChainContext, Result, Step, TestDescription, runMe; |
13 | 15 |
14 import 'package:front_end/src/fasta/testing/patched_sdk_location.dart' | 16 import 'package:front_end/src/fasta/testing/patched_sdk_location.dart' |
15 show computePatchedSdk; | 17 show computePatchedSdk; |
16 | 18 |
17 import 'package:kernel/ast.dart' show Program; | 19 import 'package:kernel/ast.dart' show Program; |
18 | 20 |
19 import 'package:kernel/transformations/closure_conversion.dart' | 21 import 'package:kernel/transformations/closure_conversion.dart' |
20 as closure_conversion; | 22 as closure_conversion; |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 | 120 |
119 class ClosureConversion | 121 class ClosureConversion |
120 extends Step<Program, Program, ClosureConversionContext> { | 122 extends Step<Program, Program, ClosureConversionContext> { |
121 const ClosureConversion(); | 123 const ClosureConversion(); |
122 | 124 |
123 String get name => "closure conversion"; | 125 String get name => "closure conversion"; |
124 | 126 |
125 Future<Result<Program>> run( | 127 Future<Result<Program>> run( |
126 Program program, ClosureConversionContext testContext) async { | 128 Program program, ClosureConversionContext testContext) async { |
127 try { | 129 try { |
128 program = closure_conversion.transformProgram(program); | 130 CoreTypes coreTypes = new CoreTypes(program); |
| 131 program = closure_conversion.transformProgram(coreTypes, program); |
129 return pass(program); | 132 return pass(program); |
130 } catch (e, s) { | 133 } catch (e, s) { |
131 return crash(e, s); | 134 return crash(e, s); |
132 } | 135 } |
133 } | 136 } |
134 } | 137 } |
135 | 138 |
136 main(List<String> arguments) => runMe(arguments, createContext, "testing.json"); | 139 main(List<String> arguments) => runMe(arguments, createContext, "testing.json"); |
OLD | NEW |