| Index: sdk/lib/_internal/compiler/implementation/resolution/members.dart
|
| diff --git a/sdk/lib/_internal/compiler/implementation/resolution/members.dart b/sdk/lib/_internal/compiler/implementation/resolution/members.dart
|
| index 46d678dca016129d6212158b20fba1f2a1ca20f8..8043517e444cc077f232165c333282291f8fe848 100644
|
| --- a/sdk/lib/_internal/compiler/implementation/resolution/members.dart
|
| +++ b/sdk/lib/_internal/compiler/implementation/resolution/members.dart
|
| @@ -3207,17 +3207,23 @@ class ClassResolverVisitor extends TypeDefinitionVisitor {
|
| element.supertype = resolveSupertype(element, node.superclass);
|
| }
|
| }
|
| -
|
| - // If the super type isn't specified, we make it Object.
|
| - final objectElement = compiler.objectClass;
|
| - if (!identical(element, objectElement) && element.supertype == null) {
|
| - if (objectElement == null) {
|
| - compiler.internalError("Internal error: cannot resolve Object",
|
| - node: node);
|
| - } else {
|
| - objectElement.ensureResolved(compiler);
|
| + // If the super type isn't specified, we provide a default. The language
|
| + // specifies [Object] but the backend can pick a specific 'implementation'
|
| + // of Object - the JavaScript backend chooses between Object and
|
| + // Interceptor.
|
| + if (element.supertype == null) {
|
| + ClassElement superElement = compiler.backend.defaultSuperclass(element);
|
| + // Avoid making the superclass (usually Object) extend itself.
|
| + if (element != superElement) {
|
| + if (superElement == null) {
|
| + compiler.internalError(
|
| + "Cannot resolve default superclass for $element",
|
| + node: node);
|
| + } else {
|
| + superElement.ensureResolved(compiler);
|
| + }
|
| + element.supertype = superElement.computeType(compiler);
|
| }
|
| - element.supertype = objectElement.computeType(compiler);
|
| }
|
|
|
| assert(element.interfaces == null);
|
|
|