refactor(core): remove readonly getters in common, compiler (#19150)

PR Close #19150
This commit is contained in:
Yuan Gao
2017-09-11 15:10:19 -07:00
committed by Matias Niemelä
parent 996c7c2dde
commit 0c44e733ad
6 changed files with 56 additions and 52 deletions

View File

@ -207,13 +207,16 @@ export function isPromise(obj: any): obj is Promise<any> {
}
export class Version {
constructor(public full: string) {}
public readonly major: string;
public readonly minor: string;
public readonly patch: string;
get major(): string { return this.full.split('.')[0]; }
get minor(): string { return this.full.split('.')[1]; }
get patch(): string { return this.full.split('.').slice(2).join('.'); }
constructor(public full: string) {
const splits = full.split('.');
this.major = splits[0];
this.minor = splits[1];
this.patch = splits.slice(2).join('.');
}
}
export interface Console {