File: destructuringControlFlowNoCrash.symbols

package info (click to toggle)
node-typescript 5.0.4%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 459,116 kB
  • sloc: javascript: 1,972,754; makefile: 6; sh: 1
file content (28 lines) | stat: -rw-r--r-- 1,024 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
=== tests/cases/compiler/destructuringControlFlowNoCrash.ts ===
// legal JS, if nonsensical, which also triggers the issue
const {
  date,
>date : Symbol(date, Decl(destructuringControlFlowNoCrash.ts, 1, 7))

} = (inspectedElement: any) => 0;
>inspectedElement : Symbol(inspectedElement, Decl(destructuringControlFlowNoCrash.ts, 3, 5))

date.toISOString();
>date : Symbol(date, Decl(destructuringControlFlowNoCrash.ts, 1, 7))

// Working flow code
const {
  date2,
>date2 : Symbol(date2, Decl(destructuringControlFlowNoCrash.ts, 8, 7))

} = (inspectedElement: any).props;
>inspectedElement : Symbol(inspectedElement, Decl(destructuringControlFlowNoCrash.ts, 10, 5))
>props : Symbol(props, Decl(destructuringControlFlowNoCrash.ts, 10, 28))

date2.toISOString();
>date2 : Symbol(date2, Decl(destructuringControlFlowNoCrash.ts, 8, 7))

// It could also be an async function
const { constructor } = async () => {};
>constructor : Symbol(constructor, Decl(destructuringControlFlowNoCrash.ts, 15, 7))