Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit cccf22a

Browse filesBrowse files
Accepted baselines.
1 parent b47f01a commit cccf22a
Copy full SHA for cccf22a

4 files changed

+91Lines changed: 91 additions & 0 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎tests/baselines/reference/useUnknownInCatchVariables01.errors.txt‎

Copy file name to clipboardExpand all lines: tests/baselines/reference/useUnknownInCatchVariables01.errors.txt
+12Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,18 @@ tests/cases/compiler/useUnknownInCatchVariables01.ts(8,10): error TS2349: This e
3030
e.stack?.toUpperCase();
3131
}
3232
if (typeof e === "number") {
33+
e.toExponential();
3334
e++;
3435
}
36+
}
37+
38+
39+
try {
40+
// ...
41+
}
42+
catch (e: any) {
43+
// All are allowed.
44+
void e.toUpperCase();
45+
void e.toExponential();
46+
void e();
3547
}
Collapse file

‎tests/baselines/reference/useUnknownInCatchVariables01.js‎

Copy file name to clipboardExpand all lines: tests/baselines/reference/useUnknownInCatchVariables01.js
+22Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,20 @@ catch (e) {
1717
e.stack?.toUpperCase();
1818
}
1919
if (typeof e === "number") {
20+
e.toExponential();
2021
e++;
2122
}
23+
}
24+
25+
26+
try {
27+
// ...
28+
}
29+
catch (e: any) {
30+
// All are allowed.
31+
void e.toUpperCase();
32+
void e.toExponential();
33+
void e();
2234
}
2335

2436
//// [useUnknownInCatchVariables01.js]
@@ -40,6 +52,16 @@ catch (e) {
4052
(_a = e.stack) === null || _a === void 0 ? void 0 : _a.toUpperCase();
4153
}
4254
if (typeof e === "number") {
55+
e.toExponential();
4356
e++;
4457
}
4558
}
59+
try {
60+
// ...
61+
}
62+
catch (e) {
63+
// All are allowed.
64+
void e.toUpperCase();
65+
void e.toExponential();
66+
void e();
67+
}
Collapse file

‎tests/baselines/reference/useUnknownInCatchVariables01.symbols‎

Copy file name to clipboardExpand all lines: tests/baselines/reference/useUnknownInCatchVariables01.symbols
+23Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,30 @@ catch (e) {
4242
if (typeof e === "number") {
4343
>e : Symbol(e, Decl(useUnknownInCatchVariables01.ts, 3, 7))
4444

45+
e.toExponential();
46+
>e.toExponential : Symbol(Number.toExponential, Decl(lib.es5.d.ts, --, --))
47+
>e : Symbol(e, Decl(useUnknownInCatchVariables01.ts, 3, 7))
48+
>toExponential : Symbol(Number.toExponential, Decl(lib.es5.d.ts, --, --))
49+
4550
e++;
4651
>e : Symbol(e, Decl(useUnknownInCatchVariables01.ts, 3, 7))
4752
}
4853
}
54+
55+
56+
try {
57+
// ...
58+
}
59+
catch (e: any) {
60+
>e : Symbol(e, Decl(useUnknownInCatchVariables01.ts, 27, 7))
61+
62+
// All are allowed.
63+
void e.toUpperCase();
64+
>e : Symbol(e, Decl(useUnknownInCatchVariables01.ts, 27, 7))
65+
66+
void e.toExponential();
67+
>e : Symbol(e, Decl(useUnknownInCatchVariables01.ts, 27, 7))
68+
69+
void e();
70+
>e : Symbol(e, Decl(useUnknownInCatchVariables01.ts, 27, 7))
71+
}
Collapse file

‎tests/baselines/reference/useUnknownInCatchVariables01.types‎

Copy file name to clipboardExpand all lines: tests/baselines/reference/useUnknownInCatchVariables01.types
+34Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,42 @@ catch (e) {
6060
>e : unknown
6161
>"number" : "number"
6262

63+
e.toExponential();
64+
>e.toExponential() : string
65+
>e.toExponential : (fractionDigits?: number) => string
66+
>e : number
67+
>toExponential : (fractionDigits?: number) => string
68+
6369
e++;
6470
>e++ : number
6571
>e : number
6672
}
6773
}
74+
75+
76+
try {
77+
// ...
78+
}
79+
catch (e: any) {
80+
>e : any
81+
82+
// All are allowed.
83+
void e.toUpperCase();
84+
>void e.toUpperCase() : undefined
85+
>e.toUpperCase() : any
86+
>e.toUpperCase : any
87+
>e : any
88+
>toUpperCase : any
89+
90+
void e.toExponential();
91+
>void e.toExponential() : undefined
92+
>e.toExponential() : any
93+
>e.toExponential : any
94+
>e : any
95+
>toExponential : any
96+
97+
void e();
98+
>void e() : undefined
99+
>e() : any
100+
>e : any
101+
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.