File: invalidTryStatements.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 (44 lines) | stat: -rw-r--r-- 1,913 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
35
36
37
38
39
40
41
42
43
44
tests/cases/conformance/statements/tryStatements/invalidTryStatements.ts(2,5): error TS1005: 'try' expected.
tests/cases/conformance/statements/tryStatements/invalidTryStatements.ts(6,12): error TS1472: 'catch' or 'finally' expected.
tests/cases/conformance/statements/tryStatements/invalidTryStatements.ts(10,5): error TS1005: 'try' expected.
tests/cases/conformance/statements/tryStatements/invalidTryStatements.ts(11,5): error TS1005: 'try' expected.
tests/cases/conformance/statements/tryStatements/invalidTryStatements.ts(15,5): error TS1005: 'try' expected.
tests/cases/conformance/statements/tryStatements/invalidTryStatements.ts(17,5): error TS1005: 'try' expected.
tests/cases/conformance/statements/tryStatements/invalidTryStatements.ts(19,20): error TS1003: Identifier expected.


==== tests/cases/conformance/statements/tryStatements/invalidTryStatements.ts (7 errors) ====
    function fn() {
        catch(x) { } // error missing try
        ~~~~~
!!! error TS1005: 'try' expected.
    
        finally { } // potential error; can be absorbed by the 'catch'
    
        try { }; // error missing finally
               ~
!!! error TS1472: 'catch' or 'finally' expected.
    }
    
    function fn2() {
        finally { } // error missing try
        ~~~~~~~
!!! error TS1005: 'try' expected.
        catch (x) { } // error missing try
        ~~~~~
!!! error TS1005: 'try' expected.
        
        try { } finally { } // statement is here, so the 'catch' clause above doesn't absorb errors from the 'finally' clause below
    
        finally { } // error missing try
        ~~~~~~~
!!! error TS1005: 'try' expected.
        
        catch (x) { } // error missing try
        ~~~~~
!!! error TS1005: 'try' expected.
    
        try { } catch () { } // error missing catch binding
                       ~
!!! error TS1003: Identifier expected.
    }