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

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

Issue 2935933005: fix mixins with factory constructors (Closed)
Patch Set: d Created 3 years, 6 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/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 6a2e36ad82d200cb4f4952c01268327022b4ade8..6d3de87bb788021113fc1f0acf0a82ba788f26a3 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
@@ -46,7 +46,8 @@ mixin(base, @rest mixins) => JS(
// Run mixin initializers. They cannot have arguments.
// Run them backwards so most-derived mixin is initialized first.
for (let i = $mixins.length - 1; i >= 0; i--) {
- $mixins[i].new.call(this);
+ let m = $mixins[i];
+ (m[$mixinNew] || m.new).call(this);
}
// Run base initializer.
$base[memberName].apply(this, args);
@@ -109,6 +110,8 @@ final _typeArguments = JS('', 'Symbol("typeArguments")');
final _originalDeclaration = JS('', 'Symbol("originalDeclaration")');
+final mixinNew = JS('', 'Symbol("dart.mixinNew")');
+
/// Wrap a generic class builder function with future flattening.
flattenFutures(builder) => JS(
'',
« no previous file with comments | « pkg/dev_compiler/lib/src/compiler/code_generator.dart ('k') | tests/language_strong/mixin_factory_constructor_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698