Index: pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/classes.dart |
diff --git a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/classes.dart b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/classes.dart |
index a0f02c7ac40553dacd76821115e80be28454f948..ef561b18fbdaaee0f28f59cf977d98403c07cc9c 100644 |
--- a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/classes.dart |
+++ b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/classes.dart |
@@ -29,10 +29,16 @@ mixin(base, @rest mixins) => JS( |
// Create a class that will hold all of the mixin methods. |
class Mixin extends $base {} |
+ // Save the original constructor. For ClassTypeAlias definitions, this |
+ // is the concrete type. We embed metadata (e.g., implemented interfaces) |
+ // on this constructor and need to access that from runtime instances. |
+ var constructor = Mixin.prototype.constructor; |
// Copy each mixin's methods, with later ones overwriting earlier entries. |
for (let m of $mixins) { |
$copyProperties(Mixin.prototype, m.prototype); |
Jennifer Messerly
2017/03/28 20:47:48
hmm, maybe just skip "constructor" when copying pr
|
} |
+ // Restore original Mixin constructor. |
+ Mixin.prototype.constructor = constructor; |
// Initializer method: run mixin initializers, then the base. |
Mixin.prototype.new = function(...args) { |
// Run mixin initializers. They cannot have arguments. |