Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions 21 packages/compiler-cli/src/ngtsc/core/src/host.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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<M extends keyof ExtendedTsCompilerHost>(name: M):
Expand Down Expand Up @@ -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?
Expand All @@ -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;
}
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.