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 file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library kernel.transformations.closure_conversion; | 5 library kernel.transformations.closure_conversion; |
6 | 6 |
7 import '../ast.dart' show Class, Program; | 7 import '../ast.dart' show Class, Program; |
8 | 8 |
9 import '../core_types.dart' show CoreTypes; | 9 import '../core_types.dart' show CoreTypes; |
10 | 10 |
11 import 'closure/converter.dart' show ClosureConverter; | 11 import 'closure/converter.dart' show ClosureConverter; |
12 | 12 |
13 import 'closure/info.dart' show ClosureInfo; | 13 import 'closure/info.dart' show ClosureInfo; |
14 | 14 |
15 import 'closure/invalidate_closures.dart'; | 15 import 'closure/invalidate_closures.dart'; |
16 import 'closure/mock.dart' show mockUpContext; | 16 import 'closure/mock.dart' show mockUpContext; |
17 | 17 |
18 Program transformProgram(Program program) { | 18 Program transformProgram(CoreTypes coreTypes, Program program) { |
19 var info = new ClosureInfo(); | 19 var info = new ClosureInfo(); |
20 info.visitProgram(program); | 20 info.visitProgram(program); |
21 | 21 |
22 CoreTypes coreTypes = new CoreTypes(program); | |
23 Class contextClass = mockUpContext(coreTypes, program); | 22 Class contextClass = mockUpContext(coreTypes, program); |
24 var convert = new ClosureConverter(coreTypes, info, contextClass); | 23 var convert = new ClosureConverter(coreTypes, info, contextClass); |
25 program = convert.visitProgram(program); | 24 program = convert.visitProgram(program); |
26 return new InvalidateClosures().visitProgram(program); | 25 return new InvalidateClosures().visitProgram(program); |
27 } | 26 } |
OLD | NEW |