Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(112)

Unified Diff: pkg/kernel/lib/transformations/mixin_full_resolution.dart

Issue 2912503003: Perform MixinFullResolution only for source libraries. (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/kernel/lib/target/vm.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/kernel/lib/transformations/mixin_full_resolution.dart
diff --git a/pkg/kernel/lib/transformations/mixin_full_resolution.dart b/pkg/kernel/lib/transformations/mixin_full_resolution.dart
index 0fbb388f8781ac254283066388e11f39c8a2aeb5..4d3c0f94eaaadc8204c01f126482264b01aa0778 100644
--- a/pkg/kernel/lib/transformations/mixin_full_resolution.dart
+++ b/pkg/kernel/lib/transformations/mixin_full_resolution.dart
@@ -7,12 +7,11 @@ import '../ast.dart';
import '../class_hierarchy.dart';
import '../clone.dart';
import '../core_types.dart';
-import '../target/targets.dart' show NoneTarget, Target;
+import '../target/targets.dart' show Target;
import '../type_algebra.dart';
-Program transformProgram(Program program) {
- new MixinFullResolution(new NoneTarget(null)).transform(program);
- return program;
+void transformLibraries(Target targetInfo, List<Library> libraries) {
+ new MixinFullResolution(targetInfo).transform(libraries);
}
/// Replaces all mixin applications with regular classes, cloning all fields
@@ -29,13 +28,15 @@ class MixinFullResolution {
MixinFullResolution(this.targetInfo);
- void transform(Program program) {
+ void transform(List<Library> libraries) {
+ if (libraries.isEmpty) return;
+
var transformedClasses = new Set<Class>();
// Desugar all mixin application classes by copying in fields/methods from
// the mixin and constructors from the base class.
var processedClasses = new Set<Class>();
- for (var library in program.libraries) {
+ for (var library in libraries) {
if (library.isExternal) continue;
for (var class_ in library.classes) {
@@ -43,11 +44,12 @@ class MixinFullResolution {
}
}
+ var program = libraries.first.enclosingProgram;
Siggi Cherem (dart-lang) 2017/05/26 22:08:32 consider adding a TODO that this reference will be
scheglov 2017/05/30 04:20:15 Done.
hierarchy = new ClassHierarchy(program);
coreTypes = new CoreTypes(program);
// Resolve all super call expressions and super initializers.
- for (var library in program.libraries) {
+ for (var library in libraries) {
if (library.isExternal) continue;
for (var class_ in library.classes) {
« no previous file with comments | « pkg/kernel/lib/target/vm.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698