File: jsFileCompilationBindStrictModeErrors.types

package info (click to toggle)
node-typescript 3.3.3333-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 324,548 kB
  • sloc: makefile: 6; sh: 3
file content (84 lines) | stat: -rw-r--r-- 1,369 bytes parent folder | download | duplicates (5)
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
=== tests/cases/compiler/a.js ===
"use strict";
>"use strict" : "use strict"

var a = {
>a : { a: number; b: number; }
>{    a: "hello", // error    b: 10,    a: 10 // error} : { a: number; b: number; }

    a: "hello", // error
>a : string
>"hello" : "hello"

    b: 10,
>b : number
>10 : 10

    a: 10 // error
>a : string
>10 : 10

};
var let = 10; // error
>let : number
>10 : 10

delete a; // error
>delete a : boolean
>a : { a: number; b: number; }

try {
} catch (eval) { // error
>eval : any
}
function arguments() { // error
>arguments : () => void
}

with (a) {
>a : { a: number; b: number; }

    b = 10;
>b = 10 : any
>b : any
>10 : any
}

=== tests/cases/compiler/b.js ===
// this is not in strict mode but class definitions are always in strict mode
class c {
>c : c

    a(eval) { //error
>a : (eval: any) => void
>eval : any
    }
    method() {
>method : () => void

        var let = 10; // error
>let : number
>10 : 10
    }
}

=== tests/cases/compiler/c.js ===
export var let = 10; // external modules are automatically in strict mode
>let : number
>10 : 10

var eval = function () {
>eval : () => void
>function () {} : () => void

};

=== tests/cases/compiler/d.js ===
"use strict";
>"use strict" : "use strict"

var x = 009; // error
>x : number
>00 : 0
>9 : 9