mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Accepted baselines.
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user