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

Unified Diff: pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/classes.dart

Issue 2779063002: One more minor mixin fix (Closed)
Patch Set: Created 3 years, 9 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/dev_compiler/test/browser/language_tests.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « pkg/dev_compiler/test/browser/language_tests.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698