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

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

Issue 2671653003: Split the Kernel transformations into modular and global ones (Closed)
Patch Set: Revert inadvertent change Created 3 years, 11 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
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 b045ee6b511defbdb1c0bc288ce20edc6f615cf7..92ed3b7685e502e92bcf3d573ddd79747acb2e70 100644
--- a/pkg/kernel/lib/transformations/mixin_full_resolution.dart
+++ b/pkg/kernel/lib/transformations/mixin_full_resolution.dart
@@ -31,6 +31,8 @@ class MixinFullResolution {
// the mixin and constructors from the base class.
var processedClasses = new Set<Class>();
for (var library in program.libraries) {
+ if (library.isExternal) continue;
+
for (var class_ in library.classes) {
transformClass(processedClasses, transformedClasses, class_);
}
@@ -41,6 +43,8 @@ class MixinFullResolution {
// Resolve all super call expressions and super initializers.
for (var library in program.libraries) {
+ if (library.isExternal) continue;
+
for (var class_ in library.classes) {
final bool hasTransformedSuperclass =
transformedClasses.contains(class_.superclass);
@@ -82,6 +86,12 @@ class MixinFullResolution {
// constructors in this class.
if (!class_.isMixinApplication) return;
+ if (class_.mixedInClass.level != ClassLevel.Body) {
+ throw new Exception(
+ 'Class "${class_.name}" mixes in "${class_.mixedInClass.name}" from'
+ ' an external library. Did you forget --link?');
+ }
+
transformedClasses.add(class_);
// Clone fields and methods from the mixin class.

Powered by Google App Engine
This is Rietveld 408576698