mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
add test for catch with type unknown
This commit is contained in:
@@ -90,6 +90,13 @@
|
||||
| tst.ts:43:26:43:48 | { foo: ... s const | { readonly foo: "foo"; } |
|
||||
| tst.ts:43:28:43:30 | foo | "foo" |
|
||||
| tst.ts:43:33:43:37 | "foo" | "foo" |
|
||||
| tst.ts:47:8:47:8 | e | unknown |
|
||||
| tst.ts:48:7:48:14 | typeof e | "string" \| "number" \| "bigint" \| "boolean" \| "s... |
|
||||
| tst.ts:48:7:48:27 | typeof ... string" | boolean |
|
||||
| tst.ts:48:14:48:14 | e | unknown |
|
||||
| tst.ts:48:20:48:27 | "string" | "string" |
|
||||
| tst.ts:49:11:49:11 | b | string |
|
||||
| tst.ts:49:24:49:24 | e | string |
|
||||
| type_alias.ts:3:5:3:5 | b | boolean |
|
||||
| type_alias.ts:7:5:7:5 | c | ValueOrArray<number> |
|
||||
| type_alias.ts:14:9:14:32 | [proper ... ]: Json | any |
|
||||
|
||||
@@ -68,6 +68,7 @@
|
||||
| tst.ts:39:60:39:65 | number | number |
|
||||
| tst.ts:39:60:39:67 | number[] | number[] |
|
||||
| tst.ts:40:18:40:24 | unknown | unknown |
|
||||
| tst.ts:49:15:49:20 | string | string |
|
||||
| type_alias.ts:1:6:1:6 | B | boolean |
|
||||
| type_alias.ts:1:10:1:16 | boolean | boolean |
|
||||
| type_alias.ts:3:8:3:8 | B | boolean |
|
||||
|
||||
@@ -1 +1,3 @@
|
||||
| tst.ts:40:5:40:15 | unknownType | unknown |
|
||||
| tst.ts:47:8:47:8 | e | unknown |
|
||||
| tst.ts:48:14:48:14 | e | unknown |
|
||||
|
||||
@@ -41,3 +41,11 @@ let unknownType: unknown;
|
||||
|
||||
let constArrayLiteral = [1, 2] as const;
|
||||
let constObjectLiteral = { foo: "foo" } as const;
|
||||
|
||||
|
||||
try { }
|
||||
catch (e: unknown) {
|
||||
if (typeof e === "string") {
|
||||
let b : string = e;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user