Skip to content

Commit 5573279

Browse files
committed
JS: regression test for DeadStoreOfLocal
1 parent 3b962dc commit 5573279

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed

javascript/ql/test/query-tests/Declarations/DeadStoreOfLocal/DeadStoreOfLocal.expected

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
| computedInterfaceProperty.ts:1:10:1:12 | Foo | This definition of Foo is useless, since its value is never read. |
2+
| computedInterfaceProperty.ts:7:7:7:17 | Bar = "Bar" | The initial value of Bar is unused, since it is always overwritten. |
3+
| computedInterfaceProperty.ts:13:7:13:17 | Baz = "Baz" | The initial value of Baz is unused, since it is always overwritten. |
4+
| computedInterfaceProperty.ts:21:1:21:10 | class C {} | This definition of C is useless, since its value is never read. |
15
| overload.ts:10:12:10:14 | baz | This definition of baz is useless, since its value is never read. |
26
| tst2.js:26:9:26:14 | x = 23 | The initial value of x is unused, since it is always overwritten. |
37
| tst2.js:28:9:28:14 | x = 42 | This definition of x is useless, since its value is never read. |
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { Foo } from "./exportSymbol" // OK
2+
3+
export interface FooMap {
4+
[Foo]: number; // OK
5+
}
6+
7+
const Bar = "Bar"; // OK
8+
9+
export interface BarMap {
10+
[Bar]: number;
11+
}
12+
13+
const Baz = "Baz"; // OK
14+
15+
if (false) {
16+
Baz;
17+
}
18+
19+
function getBaz(): typeof Baz { return null; }
20+
21+
class C {} // OK
22+
23+
if (false) {
24+
C;
25+
}
26+
27+
function getC(): C { return null; }
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const Foo = "Foo";

0 commit comments

Comments
 (0)