diff --git a/pkg/dev_compiler/lib/src/kernel/compiler.dart b/pkg/dev_compiler/lib/src/kernel/compiler.dart index f6ce16baffe..ccd351f6836 100644 --- a/pkg/dev_compiler/lib/src/kernel/compiler.dart +++ b/pkg/dev_compiler/lib/src/kernel/compiler.dart @@ -1265,19 +1265,9 @@ class ProgramCompiler extends ComputeOnceConstantVisitor _classEmittingExtends = c; // Unroll mixins. - if (shouldDefer(supertype)) { - var originalSupertype = supertype; - deferredSupertypes.add(() => runtimeStatement('setBaseClass(#, #)', [ - getBaseClass(mixinApplications.length), - emitDeferredClassRef(originalSupertype), - ])); - // Refers to 'supertype' without type parameters. We remove these from - // the 'extends' clause for generics for cyclic dependencies and append - // them later with 'setBaseClass'. - supertype = - _coreTypes.rawType(supertype.classNode, _currentLibrary!.nonNullable); - } - var baseClass = emitClassRef(supertype); + var baseClass = shouldDefer(supertype) + ? emitDeferredClassRef(supertype) + : emitClassRef(supertype); // TODO(jmesserly): we need to unroll kernel mixins because the synthetic // classes lack required synthetic members, such as constructors. diff --git a/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/classes.dart b/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/classes.dart index 0fcfe2d31c8..dcd20a84d1b 100644 --- a/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/classes.dart +++ b/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/classes.dart @@ -531,15 +531,9 @@ definePrimitiveHashCode(proto) { getOwnPropertyDescriptor(proto, extensionSymbol('hashCode'))); } -/// Link the extension to the type it's extending as a base class. -void setBaseClass(@notNull Object derived, @notNull Object base) { - jsObjectSetPrototypeOf( - JS('', '#.prototype', derived), JS('', '#.prototype', base)); - // We use __proto__ to track the superclass hierarchy (see isSubtypeOf). - jsObjectSetPrototypeOf(derived, base); -} - -/// Like [setBaseClass], but for generic extension types such as `JSArray`. +/// Link the [dartType] to the native [jsType] it is extending as a base class. +/// +/// Used for generic extension types such as `JSArray`. void setExtensionBaseClass(@notNull Object dartType, @notNull Object jsType) { // Mark the generic type as an extension type and link the prototype objects. var dartProto = JS('!', '#.prototype', dartType);