File: unusedLocalsAndParameters.js

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 (173 lines) | stat: -rw-r--r-- 2,839 bytes parent folder | download
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
//// [unusedLocalsAndParameters.ts]
export { };

// function declaration paramter
function f(a) {
}
f(0);

// function expression paramter
var fexp = function (a) {
};

fexp(0);

// arrow function paramter
var farrow = (a) => {
};

class C {
    // Method declaration paramter
    method(a) {
    }
    // Accessor declaration paramter
    set x(v: number) {
    }
}

var E = class {
    // Method declaration paramter
    method(a) {
    }
    // Accessor declaration paramter
    set x(v: number) {
    }
}

var o = {
    // Object literal method declaration paramter
    method(a) {
    },
    // Accessor declaration paramter
    set x(v: number) {
    }
};

o;

// in a for..in statment
for (let i in o) {
}

// in a for..of statment
for (let i of [1, 2, 3]) {
}

// in a for. statment
for (let i = 0, n; i < 10; i++) {
}

// in a block

const condition = false;
if (condition) {
    const c = 0;
}

// in try/catch/finally
try {
    const a = 0;
}
catch (e) {
    const c = 1;
}
finally {
    const c = 0;
}


// in a namespace
namespace N {
    var x;
}

for (let x: y) {
    z(x);
}


//// [unusedLocalsAndParameters.js]
"use strict";
exports.__esModule = true;
// function declaration paramter
function f(a) {
}
f(0);
// function expression paramter
var fexp = function (a) {
};
fexp(0);
// arrow function paramter
var farrow = function (a) {
};
var C = /** @class */ (function () {
    function C() {
    }
    // Method declaration paramter
    C.prototype.method = function (a) {
    };
    Object.defineProperty(C.prototype, "x", {
        // Accessor declaration paramter
        set: function (v) {
        },
        enumerable: true,
        configurable: true
    });
    return C;
}());
var E = /** @class */ (function () {
    function class_1() {
    }
    // Method declaration paramter
    class_1.prototype.method = function (a) {
    };
    Object.defineProperty(class_1.prototype, "x", {
        // Accessor declaration paramter
        set: function (v) {
        },
        enumerable: true,
        configurable: true
    });
    return class_1;
}());
var o = {
    // Object literal method declaration paramter
    method: function (a) {
    },
    // Accessor declaration paramter
    set x(v) {
    }
};
o;
// in a for..in statment
for (var i in o) {
}
// in a for..of statment
for (var _i = 0, _a = [1, 2, 3]; _i < _a.length; _i++) {
    var i = _a[_i];
}
// in a for. statment
for (var i = 0, n = void 0; i < 10; i++) {
}
// in a block
var condition = false;
if (condition) {
    var c = 0;
}
// in try/catch/finally
try {
    var a = 0;
}
catch (e) {
    var c = 1;
}
finally {
    var c = 0;
}
// in a namespace
var N;
(function (N) {
    var x;
})(N || (N = {}));
for (var x = void 0, z = (void 0).z; (x); )
    ;