File: destructuringControlFlowNoCrash.errors.txt

package info (click to toggle)
node-typescript 5.0.4%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 459,140 kB
  • sloc: javascript: 1,972,754; makefile: 6; sh: 1
file content (34 lines) | stat: -rw-r--r-- 1,765 bytes parent folder | download | duplicates (3)
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
29
30
31
32
33
34
error TS2468: Cannot find global value 'Promise'.
tests/cases/compiler/destructuringControlFlowNoCrash.ts(3,3): error TS2339: Property 'date' does not exist on type '(inspectedElement: any) => number'.
tests/cases/compiler/destructuringControlFlowNoCrash.ts(10,3): error TS2339: Property 'date2' does not exist on type '(inspectedElement: any) => any'.
tests/cases/compiler/destructuringControlFlowNoCrash.ts(11,28): error TS1005: '=>' expected.
tests/cases/compiler/destructuringControlFlowNoCrash.ts(16,25): error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor.  Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.


!!! error TS2468: Cannot find global value 'Promise'.
==== tests/cases/compiler/destructuringControlFlowNoCrash.ts (4 errors) ====
    // legal JS, if nonsensical, which also triggers the issue
    const {
      date,
      ~~~~
!!! error TS2339: Property 'date' does not exist on type '(inspectedElement: any) => number'.
    } = (inspectedElement: any) => 0;
    
    date.toISOString();
    
    // Working flow code
    const {
      date2,
      ~~~~~
!!! error TS2339: Property 'date2' does not exist on type '(inspectedElement: any) => any'.
    } = (inspectedElement: any).props;
                               ~
!!! error TS1005: '=>' expected.
    
    date2.toISOString();
    
    // It could also be an async function
    const { constructor } = async () => {};
                            ~~~~~~~~~~~~~~
!!! error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor.  Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.