| 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:analyzer/src/generated/sdk.dart' show DartSdk; | 9 import 'package:analyzer/src/generated/sdk.dart' show DartSdk; |
| 10 | 10 |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 class FastaCompile | 108 class FastaCompile |
| 109 extends Step<TestDescription, Program, ClosureConversionContext> { | 109 extends Step<TestDescription, Program, ClosureConversionContext> { |
| 110 const FastaCompile(); | 110 const FastaCompile(); |
| 111 | 111 |
| 112 String get name => "fasta compilation"; | 112 String get name => "fasta compilation"; |
| 113 | 113 |
| 114 Future<Result<Program>> run( | 114 Future<Result<Program>> run( |
| 115 TestDescription description, ClosureConversionContext context) async { | 115 TestDescription description, ClosureConversionContext context) async { |
| 116 Program platform = await context.createPlatform(); | 116 Program platform = await context.createPlatform(); |
| 117 Ticker ticker = new Ticker(); | 117 Ticker ticker = new Ticker(); |
| 118 DillTarget dillTarget = new DillTarget(ticker, context.uriTranslator); | 118 DillTarget dillTarget = |
| 119 new DillTarget(ticker, context.uriTranslator, false); |
| 119 dillTarget.loader | 120 dillTarget.loader |
| 120 ..input = Uri.parse("org.dartlang:platform") // Make up a name. | 121 ..input = Uri.parse("org.dartlang:platform") // Make up a name. |
| 121 ..setProgram(platform); | 122 ..setProgram(platform); |
| 122 KernelTarget sourceTarget = | 123 KernelTarget sourceTarget = |
| 123 new KernelTarget(dillTarget, context.uriTranslator, false); | 124 new KernelTarget(dillTarget, context.uriTranslator, false, false); |
| 124 | 125 |
| 125 Program p; | 126 Program p; |
| 126 try { | 127 try { |
| 127 sourceTarget.read(description.uri); | 128 sourceTarget.read(description.uri); |
| 128 await dillTarget.writeOutline(null); | 129 await dillTarget.writeOutline(null); |
| 129 await sourceTarget.writeOutline(null); | 130 await sourceTarget.writeOutline(null); |
| 130 p = await sourceTarget.writeProgram(null); | 131 p = await sourceTarget.writeProgram(null); |
| 131 } on InputError catch (e, s) { | 132 } on InputError catch (e, s) { |
| 132 return fail(null, e.error, s); | 133 return fail(null, e.error, s); |
| 133 } | 134 } |
| (...skipping 12 matching lines...) Expand all Loading... |
| 146 try { | 147 try { |
| 147 program = closure_conversion.transformProgram(program); | 148 program = closure_conversion.transformProgram(program); |
| 148 return pass(program); | 149 return pass(program); |
| 149 } catch (e, s) { | 150 } catch (e, s) { |
| 150 return crash(e, s); | 151 return crash(e, s); |
| 151 } | 152 } |
| 152 } | 153 } |
| 153 } | 154 } |
| 154 | 155 |
| 155 main(List<String> arguments) => runMe(arguments, createContext, "testing.json"); | 156 main(List<String> arguments) => runMe(arguments, createContext, "testing.json"); |
| OLD | NEW |