Accepted baselines.

This commit is contained in:
Daniel Rosenwasser
2020-12-02 13:18:34 -08:00
parent b47f01abb0
commit cccf22a3cf
4 changed files with 91 additions and 0 deletions
@@ -30,6 +30,18 @@ tests/cases/compiler/useUnknownInCatchVariables01.ts(8,10): error TS2349: This e
e.stack?.toUpperCase();
}
if (typeof e === "number") {
e.toExponential();
e++;
}
}
try {
// ...
}
catch (e: any) {
// All are allowed.
void e.toUpperCase();
void e.toExponential();
void e();
}
@@ -17,8 +17,20 @@ catch (e) {
e.stack?.toUpperCase();
}
if (typeof e === "number") {
e.toExponential();
e++;
}
}
try {
// ...
}
catch (e: any) {
// All are allowed.
void e.toUpperCase();
void e.toExponential();
void e();
}
//// [useUnknownInCatchVariables01.js]
@@ -40,6 +52,16 @@ catch (e) {
(_a = e.stack) === null || _a === void 0 ? void 0 : _a.toUpperCase();
}
if (typeof e === "number") {
e.toExponential();
e++;
}
}
try {
// ...
}
catch (e) {
// All are allowed.
void e.toUpperCase();
void e.toExponential();
void e();
}
@@ -42,7 +42,30 @@ catch (e) {
if (typeof e === "number") {
>e : Symbol(e, Decl(useUnknownInCatchVariables01.ts, 3, 7))
e.toExponential();
>e.toExponential : Symbol(Number.toExponential, Decl(lib.es5.d.ts, --, --))
>e : Symbol(e, Decl(useUnknownInCatchVariables01.ts, 3, 7))
>toExponential : Symbol(Number.toExponential, Decl(lib.es5.d.ts, --, --))
e++;
>e : Symbol(e, Decl(useUnknownInCatchVariables01.ts, 3, 7))
}
}
try {
// ...
}
catch (e: any) {
>e : Symbol(e, Decl(useUnknownInCatchVariables01.ts, 27, 7))
// All are allowed.
void e.toUpperCase();
>e : Symbol(e, Decl(useUnknownInCatchVariables01.ts, 27, 7))
void e.toExponential();
>e : Symbol(e, Decl(useUnknownInCatchVariables01.ts, 27, 7))
void e();
>e : Symbol(e, Decl(useUnknownInCatchVariables01.ts, 27, 7))
}
@@ -60,8 +60,42 @@ catch (e) {
>e : unknown
>"number" : "number"
e.toExponential();
>e.toExponential() : string
>e.toExponential : (fractionDigits?: number) => string
>e : number
>toExponential : (fractionDigits?: number) => string
e++;
>e++ : number
>e : number
}
}
try {
// ...
}
catch (e: any) {
>e : any
// All are allowed.
void e.toUpperCase();
>void e.toUpperCase() : undefined
>e.toUpperCase() : any
>e.toUpperCase : any
>e : any
>toUpperCase : any
void e.toExponential();
>void e.toExponential() : undefined
>e.toExponential() : any
>e.toExponential : any
>e : any
>toExponential : any
void e();
>void e() : undefined
>e() : any
>e : any
}