diff --git a/packages/compiler-cli/src/ngtsc/core/src/host.ts b/packages/compiler-cli/src/ngtsc/core/src/host.ts index 555d9dd93670..2c5a72f3deda 100644 --- a/packages/compiler-cli/src/ngtsc/core/src/host.ts +++ b/packages/compiler-cli/src/ngtsc/core/src/host.ts @@ -61,7 +61,17 @@ export class DelegatingCompilerHost implements hasInvalidatedResolutions; resolveModuleNameLiterals; resolveTypeReferenceDirectiveReferences; - jsDocParsingMode; + + // jsDocParsingMode is not a method like the other elements above + // TODO: ignore usage can be dropped once 5.2 support is dropped + get jsDocParsingMode() { + // @ts-ignore + return this.delegate.jsDocParsingMode; + } + set jsDocParsingMode(mode) { + // @ts-ignore + this.delegate.jsDocParsingMode = mode; + } constructor(protected delegate: ExtendedTsCompilerHost) { // Excluded are 'getSourceFile' and 'fileExists', which are actually implemented by @@ -97,9 +107,6 @@ export class DelegatingCompilerHost implements this.resolveModuleNameLiterals = this.delegateMethod('resolveModuleNameLiterals'); this.resolveTypeReferenceDirectiveReferences = this.delegateMethod('resolveTypeReferenceDirectiveReferences'); - // TODO(crisbeto): can be removed when we drop support for TS 5.2. - // @ts-ignore - this.jsDocParsingMode = this.delegateMethod('jsDocParsingMode'); } private delegateMethod(name: M): @@ -256,7 +263,7 @@ export class NgCompilerHost extends DelegatingCompilerHost implements } getSourceFile( - fileName: string, languageVersion: ts.ScriptTarget, + fileName: string, languageVersionOrOptions: ts.ScriptTarget|ts.CreateSourceFileOptions, onError?: ((message: string) => void)|undefined, shouldCreateNewSourceFile?: boolean|undefined): ts.SourceFile|undefined { // Is this a previously known shim? @@ -267,8 +274,8 @@ export class NgCompilerHost extends DelegatingCompilerHost implements } // No, so it's a file which might need shims (or a file which doesn't exist). - const sf = - this.delegate.getSourceFile(fileName, languageVersion, onError, shouldCreateNewSourceFile); + const sf = this.delegate.getSourceFile( + fileName, languageVersionOrOptions, onError, shouldCreateNewSourceFile); if (sf === undefined) { return undefined; }