Skip to content

Commit 2877531

Browse files
committed
JS: Remove invalid syntax from test
TS decorators may not appear on functions and enums
1 parent 426a871 commit 2877531

2 files changed

Lines changed: 3 additions & 11 deletions

File tree

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#select
22
| Babelrc/importPragma.jsx:2:1:2:27 | import ... react'; | Unused import q. |
3-
| decorated.ts:1:1:1:126 | import ... where'; | Unused import actionHandler. |
4-
| decorated.ts:4:10:4:12 | fun | Unused function fun. |
53
| eval.js:10:9:10:24 | not_used_by_eval | Unused variable not_used_by_eval. |
64
| eval.js:19:9:19:24 | not_used_by_eval | Unused variable not_used_by_eval. |
75
| externs.js:5:5:5:13 | iAmUnused | Unused variable iAmUnused. |
Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
1-
import {actionHandler, actionHandlerFactory, actionHandlerFactoryProvider, actionHandlerFactoryProviderKind} from 'somewhere'; // OK - imports used as decorators
2-
3-
@actionHandler
4-
function fun() {} // OK - decorator might use the function
1+
import { actionHandlerFactory, actionHandlerFactoryProvider } from 'somewhere'; // OK - imports used as decorators
52

63
@actionHandlerFactory
7-
class Class {} // OK - decorator might use the class
4+
class Class { } // OK - decorator might use the class
85

96
@actionHandlerFactoryProvider
10-
export class ExportedClass {} // OK - decorator might use the class
11-
12-
@actionHandlerFactoryProviderKind
13-
enum Enum { plain } // OK - decorator might use the enum
7+
export class ExportedClass { } // OK - decorator might use the class

0 commit comments

Comments
 (0)