| 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; | 11 import 'package:kernel/core_types.dart' show CoreTypes; |
| 12 | 12 |
| 13 import 'package:testing/testing.dart' | 13 import 'package:testing/testing.dart' |
| 14 show Chain, ChainContext, Result, Step, TestDescription, runMe; | 14 show Chain, ChainContext, Result, Step, TestDescription, runMe; |
| 15 | 15 |
| 16 import 'package:front_end/src/fasta/testing/patched_sdk_location.dart' | 16 import 'package:front_end/src/fasta/testing/patched_sdk_location.dart' |
| 17 show computePatchedSdk; | 17 show computePatchedSdk; |
| 18 | 18 |
| 19 import 'package:kernel/ast.dart' show Program; | 19 import 'package:kernel/ast.dart' show Program, Library; |
| 20 | 20 |
| 21 import 'package:kernel/transformations/closure_conversion.dart' | 21 import 'package:kernel/transformations/closure_conversion.dart' |
| 22 as closure_conversion; | 22 as closure_conversion; |
| 23 | 23 |
| 24 import 'package:front_end/src/fasta/testing/kernel_chain.dart' | 24 import 'package:front_end/src/fasta/testing/kernel_chain.dart' |
| 25 show Print, MatchExpectation, WriteDill, ReadDill, Verify; | 25 show Print, MatchExpectation, WriteDill, ReadDill, Verify; |
| 26 | 26 |
| 27 import 'package:front_end/src/fasta/ticker.dart' show Ticker; | 27 import 'package:front_end/src/fasta/ticker.dart' show Ticker; |
| 28 | 28 |
| 29 import 'package:front_end/src/fasta/dill/dill_target.dart' show DillTarget; | 29 import 'package:front_end/src/fasta/dill/dill_target.dart' show DillTarget; |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 class ClosureConversion | 126 class ClosureConversion |
| 127 extends Step<Program, Program, ClosureConversionContext> { | 127 extends Step<Program, Program, ClosureConversionContext> { |
| 128 const ClosureConversion(); | 128 const ClosureConversion(); |
| 129 | 129 |
| 130 String get name => "closure conversion"; | 130 String get name => "closure conversion"; |
| 131 | 131 |
| 132 Future<Result<Program>> run( | 132 Future<Result<Program>> run( |
| 133 Program program, ClosureConversionContext testContext) async { | 133 Program program, ClosureConversionContext testContext) async { |
| 134 try { | 134 try { |
| 135 CoreTypes coreTypes = new CoreTypes(program); | 135 CoreTypes coreTypes = new CoreTypes(program); |
| 136 program = closure_conversion.transformProgram(coreTypes, program); | 136 Library library = program.libraries |
| 137 .firstWhere((Library library) => library.importUri.scheme != "dart"); |
| 138 closure_conversion.transformLibraries(coreTypes, <Library>[library]); |
| 137 return pass(program); | 139 return pass(program); |
| 138 } catch (e, s) { | 140 } catch (e, s) { |
| 139 return crash(e, s); | 141 return crash(e, s); |
| 140 } | 142 } |
| 141 } | 143 } |
| 142 } | 144 } |
| 143 | 145 |
| 144 main(List<String> arguments) => runMe(arguments, createContext, "testing.json"); | 146 main(List<String> arguments) => runMe(arguments, createContext, "testing.json"); |
| OLD | NEW |