JS: regression test for DeadStoreOfLocal

This commit is contained in:
Asger F
2019-09-04 11:05:36 +01:00
parent 3b962dce22
commit 5573279580
3 changed files with 32 additions and 0 deletions

View File

@@ -1,3 +1,7 @@
| computedInterfaceProperty.ts:1:10:1:12 | Foo | This definition of Foo is useless, since its value is never read. |
| computedInterfaceProperty.ts:7:7:7:17 | Bar = "Bar" | The initial value of Bar is unused, since it is always overwritten. |
| computedInterfaceProperty.ts:13:7:13:17 | Baz = "Baz" | The initial value of Baz is unused, since it is always overwritten. |
| computedInterfaceProperty.ts:21:1:21:10 | class C {} | This definition of C is useless, since its value is never read. |
| overload.ts:10:12:10:14 | baz | This definition of baz is useless, since its value is never read. |
| tst2.js:26:9:26:14 | x = 23 | The initial value of x is unused, since it is always overwritten. |
| tst2.js:28:9:28:14 | x = 42 | This definition of x is useless, since its value is never read. |

View File

@@ -0,0 +1,27 @@
import { Foo } from "./exportSymbol" // OK
export interface FooMap {
[Foo]: number; // OK
}
const Bar = "Bar"; // OK
export interface BarMap {
[Bar]: number;
}
const Baz = "Baz"; // OK
if (false) {
Baz;
}
function getBaz(): typeof Baz { return null; }
class C {} // OK
if (false) {
C;
}
function getC(): C { return null; }

View File

@@ -0,0 +1 @@
export const Foo = "Foo";