feat: typescript 3.6 support (#32946)

BREAKING CHANGE: typescript 3.4 and 3.5 are no longer supported, please update to typescript 3.6

Fixes #32380

PR Close #32946
This commit is contained in:
Igor Minar
2019-10-01 16:44:50 -07:00
committed by Matias Niemelä
parent 117ca7cf39
commit 86e1e6c082
89 changed files with 15550 additions and 5333 deletions

View File

@ -13,7 +13,7 @@
"author": "angular",
"license": "MIT",
"peerDependencies": {
"tslib": "^1.9.0"
"tslib": "^1.10.0"
},
"repository": {
"type": "git",

View File

@ -17,7 +17,7 @@ export interface Position {
export interface FormattedMessageChain {
message: string;
position?: Position;
next?: FormattedMessageChain;
next?: FormattedMessageChain[];
}
export type FormattedError = Error & {
@ -41,9 +41,15 @@ function formatChain(chain: FormattedMessageChain | undefined, indent: number =
'';
const prefix = position && indent === 0 ? `${position}: ` : '';
const postfix = position && indent !== 0 ? ` at ${position}` : '';
const message = `${prefix}${chain.message}${postfix}`;
let message = `${prefix}${chain.message}${postfix}`;
return `${indentStr(indent)}${message}${(chain.next && ('\n' + formatChain(chain.next, indent + 2))) || ''}`;
if (chain.next) {
for (const kid of chain.next) {
message += '\n' + formatChain(kid, indent + 2);
}
}
return `${indentStr(indent)}${message}`;
}
export function formattedError(chain: FormattedMessageChain): FormattedError {

View File

@ -1056,7 +1056,7 @@ function formatMetadataMessageChain(
const next: FormattedMessageChain|undefined = chain.next ?
formatMetadataMessageChain(chain.next, advise) :
advise ? {message: advise} : undefined;
return {message, position, next};
return {message, position, next: next ? [next] : undefined};
}
function formatMetadataError(e: Error, context: StaticSymbol): Error {