diff --git a/packages/compiler-cli/ngcc/src/host/esm2015_host.ts b/packages/compiler-cli/ngcc/src/host/esm2015_host.ts index 31b88bded5..b951a6f597 100644 --- a/packages/compiler-cli/ngcc/src/host/esm2015_host.ts +++ b/packages/compiler-cli/ngcc/src/host/esm2015_host.ts @@ -318,20 +318,6 @@ export class Esm2015ReflectionHost extends TypeScriptReflectionHost implements N return null; } - hasBaseClass(clazz: ClassDeclaration): boolean { - const superHasBaseClass = super.hasBaseClass(clazz); - if (superHasBaseClass) { - return superHasBaseClass; - } - - const innerClassDeclaration = getInnerClassDeclaration(clazz); - if (innerClassDeclaration === null) { - return false; - } - - return super.hasBaseClass(innerClassDeclaration); - } - getBaseClassExpression(clazz: ClassDeclaration): ts.Expression|null { // First try getting the base class from the "outer" declaration const superBaseClassIdentifier = super.getBaseClassExpression(clazz); diff --git a/packages/compiler-cli/ngcc/src/host/esm5_host.ts b/packages/compiler-cli/ngcc/src/host/esm5_host.ts index b93d37d968..fb2d7e0e01 100644 --- a/packages/compiler-cli/ngcc/src/host/esm5_host.ts +++ b/packages/compiler-cli/ngcc/src/host/esm5_host.ts @@ -33,28 +33,6 @@ import {NgccClassSymbol} from './ngcc_host'; * */ export class Esm5ReflectionHost extends Esm2015ReflectionHost { - /** - * Determines whether the given declaration, which should be a "class", has a base "class". - * - * In ES5 code, we need to determine if the IIFE wrapper takes a `_super` parameter . - * - * @param clazz a `ClassDeclaration` representing the class over which to reflect. - */ - hasBaseClass(clazz: ClassDeclaration): boolean { - const classSymbol = this.getClassSymbol(clazz); - if (classSymbol === undefined) { - return false; - } - - const iifeBody = getIifeBody(classSymbol.declaration.valueDeclaration); - if (!iifeBody) return false; - - const iife = iifeBody.parent; - if (!iife || !ts.isFunctionExpression(iife)) return false; - - return iife.parameters.length === 1 && isSuperIdentifier(iife.parameters[0].name); - } - getBaseClassExpression(clazz: ClassDeclaration): ts.Expression|null { const classSymbol = this.getClassSymbol(clazz); if (classSymbol === undefined) { diff --git a/packages/compiler-cli/src/ngtsc/reflection/src/typescript.ts b/packages/compiler-cli/src/ngtsc/reflection/src/typescript.ts index e25a444938..b6df3545ad 100644 --- a/packages/compiler-cli/src/ngtsc/reflection/src/typescript.ts +++ b/packages/compiler-cli/src/ngtsc/reflection/src/typescript.ts @@ -128,9 +128,7 @@ export class TypeScriptReflectionHost implements ReflectionHost { } hasBaseClass(clazz: ClassDeclaration): boolean { - return (ts.isClassDeclaration(clazz) || ts.isClassExpression(clazz)) && - clazz.heritageClauses !== undefined && - clazz.heritageClauses.some(clause => clause.token === ts.SyntaxKind.ExtendsKeyword); + return this.getBaseClassExpression(clazz) !== null; } getBaseClassExpression(clazz: ClassDeclaration): ts.Expression|null {