Files
sdk/pkg/kernel/lib/transformations/closure_conversion.dart
T
Karl Klose ff99a0ce59 Merge kernel closure conversion into the Dart SDK
This is the result of:
- taking the diff of the branch closure_conversion to master in the kernel
repository
- updating the file paths
- applying the diff to the Dart SDK
- fixing conflicts between the changes to pkg/kernel in the Dart SDK and the master branch in the kernel repository

R=asgerf@google.com

Review-Url: https://codereview.chromium.org/2561723003 .
2016-12-15 10:16:22 +01:00

26 lines
831 B
Dart

// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
library kernel.transformations.closure_conversion;
import '../ast.dart' show Class, Program;
import '../core_types.dart' show CoreTypes;
import 'closure/converter.dart' show ClosureConverter;
import 'closure/info.dart' show ClosureInfo;
import 'closure/mock.dart' show mockUpContext;
Program transformProgram(Program program) {
var info = new ClosureInfo();
info.visitProgram(program);
CoreTypes coreTypes = new CoreTypes(program);
Class contextClass = mockUpContext(coreTypes, program);
var convert = new ClosureConverter(coreTypes, info, contextClass);
return convert.visitProgram(program);
}