mirror of
https://github.com/denoland/deno
synced 2024-10-30 02:21:11 +00:00
chore: improve type safety of cli/js/compiler (#6647)
This commit is contained in:
parent
f35edc574a
commit
4f60a0b3bd
2 changed files with 5 additions and 1 deletions
|
@ -245,6 +245,7 @@ class SourceFile {
|
||||||
processed = false;
|
processed = false;
|
||||||
sourceCode?: string;
|
sourceCode?: string;
|
||||||
tsSourceFile?: ts.SourceFile;
|
tsSourceFile?: ts.SourceFile;
|
||||||
|
versionHash!: string;
|
||||||
url!: string;
|
url!: string;
|
||||||
|
|
||||||
constructor(json: SourceFileJson) {
|
constructor(json: SourceFileJson) {
|
||||||
|
@ -445,7 +446,6 @@ class Host implements ts.CompilerHost {
|
||||||
sourceFile.sourceCode,
|
sourceFile.sourceCode,
|
||||||
languageVersion
|
languageVersion
|
||||||
);
|
);
|
||||||
//@ts-ignore
|
|
||||||
sourceFile.tsSourceFile.version = sourceFile.versionHash;
|
sourceFile.tsSourceFile.version = sourceFile.versionHash;
|
||||||
delete sourceFile.sourceCode;
|
delete sourceFile.sourceCode;
|
||||||
}
|
}
|
||||||
|
|
4
cli/js/ts_global.d.ts
vendored
4
cli/js/ts_global.d.ts
vendored
|
@ -29,5 +29,9 @@ declare global {
|
||||||
disable(): void;
|
disable(): void;
|
||||||
getDuration(value: string): number;
|
getDuration(value: string): number;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
interface SourceFile {
|
||||||
|
version?: string;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue