| Index: pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart
|
| diff --git a/pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart b/pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart
|
| index 89c4d2bc951befc98b8d5dc1d0f42acfc463ff8a..45274deb6970d067f296f46378403804fc3629cb 100644
|
| --- a/pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart
|
| +++ b/pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart
|
| @@ -528,19 +528,6 @@ class OldEmitter implements Emitter {
|
| })(functionSignature);
|
| }
|
|
|
| - if (#needsMixinSupport)
|
| - if (supr && supr.indexOf("+") > 0) {
|
| - s = supr.split("+");
|
| - supr = s[0];
|
| - var mixin = collectedClasses[s[1]];
|
| - if (mixin instanceof Array) mixin = mixin[1];
|
| - for (var d in mixin) {
|
| - if (hasOwnProperty.call(mixin, d) &&
|
| - !hasOwnProperty.call(desc, d))
|
| - desc[d] = mixin[d];
|
| - }
|
| - }
|
| -
|
| if (typeof dart_precompiled != "function") {
|
| combinedConstructorFunction += defineClass(cls, fields);
|
| constructorsList.push(cls);
|
| @@ -583,7 +570,6 @@ class OldEmitter implements Emitter {
|
| 'debugFastObjects': DEBUG_FAST_OBJECTS,
|
| 'hasRetainedMetadata': backend.hasRetainedMetadata,
|
| 'metadata': metadataAccess,
|
| - 'needsMixinSupport': needsMixinSupport,
|
| 'isTreeShakingDisabled': backend.isTreeShakingDisabled,
|
| 'finishClassFunction': buildFinishClass(),
|
| 'trivialNsmHandlers': nsmEmitter.buildTrivialNsmHandlers()});
|
| @@ -613,6 +599,28 @@ class OldEmitter implements Emitter {
|
| finishedClasses[cls] = true;
|
|
|
| var superclass = pendingClasses[cls];
|
| +
|
| + if (#needsMixinSupport) {
|
| + if (superclass && superclass.indexOf("+") > 0) {
|
| + var s = superclass.split("+");
|
| + superclass = s[0];
|
| + var mixinClass = s[1];
|
| + finishClass(mixinClass);
|
| + var mixin = allClasses[mixinClass];
|
| + // TODO(floitsch): this test shouldn't be necessary. Without it
|
| + // we have a crash in pkg/analysis_server/tool/spec/check_all_test.
|
| + if (mixin) {
|
| + var mixinPrototype = mixin.prototype;
|
| + var clsPrototype = allClasses[cls].prototype;
|
| + for (var d in mixinPrototype) {
|
| + if (hasOwnProperty.call(mixinPrototype, d) &&
|
| + !hasOwnProperty.call(clsPrototype, d))
|
| + clsPrototype[d] = mixinPrototype[d];
|
| + }
|
| + }
|
| + }
|
| + }
|
| +
|
| // The superclass is only false (empty string) for the Dart Object
|
| // class. The minifier together with noSuchMethod can put methods on
|
| // the Object.prototype object, and they show through here, so we check
|
| @@ -678,6 +686,7 @@ class OldEmitter implements Emitter {
|
| }
|
| }
|
| }''', {'finishedClassesAccess': finishedClassesAccess,
|
| + 'needsMixinSupport': needsMixinSupport,
|
| 'hasNativeClasses': nativeClasses.isNotEmpty,
|
| 'interceptorsByTagAccess': interceptorsByTagAccess,
|
| 'leafTagsAccess': leafTagsAccess,
|
|
|