File tree Expand file tree Collapse file tree 2 files changed +14
-5
lines changed
lib/semmle/javascript/frameworks
test/library-tests/frameworks/xUnit Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,8 @@ private predicate possiblyAttribute(Expr e, string name) {
23
23
)
24
24
}
25
25
26
+ final private class FinalExpr = Expr ;
27
+
26
28
/**
27
29
* A bracketed list of expressions.
28
30
*
@@ -34,15 +36,22 @@ private predicate possiblyAttribute(Expr e, string name) {
34
36
*
35
37
* We also allow singleton lists, as in `[a][b]`.
36
38
*/
37
- abstract private class BracketedListOfExpressions extends Expr {
39
+ abstract private class BracketedListOfExpressions extends FinalExpr {
38
40
/** Gets the `i`th element expression of this list. */
39
41
abstract Expr getElement ( int i ) ;
42
+
43
+ /** Gets the first token in this bracketed list of expressions */
44
+ Token getFirstToken ( ) { result = Expr .super .getFirstToken ( ) }
45
+
46
+ /** Gets the last token in this bracketed list of expressions */
47
+ Token getLastToken ( ) { result = Expr .super .getLastToken ( ) }
40
48
}
41
49
42
50
/**
43
51
* An array expression viewed as a bracketed list of expressions.
44
52
*/
45
- private class ArrayExprIsABracketedListOfExpressions extends ArrayExpr , BracketedListOfExpressions {
53
+ private class ArrayExprIsABracketedListOfExpressions extends BracketedListOfExpressions instanceof ArrayExpr
54
+ {
46
55
/** Gets the `i`th element of this array literal. */
47
56
override Expr getElement ( int i ) { result = ArrayExpr .super .getElement ( i ) }
48
57
}
Original file line number Diff line number Diff line change @@ -3,10 +3,10 @@ xUnitAnnotationfrom
3
3
| tst.js:5:5:5:13 | [Fixture] | tst.js:6:5:13:5 | functio ... }\\n } |
4
4
| tst.js:7:9:7:14 | [Fact] | tst.js:8:9:12:9 | functio ... } |
5
5
| tst.js:16:1:16:43 | [Import ... t.js")] | tst.js:18:1:22:2 | Test.xU ... ..]\\n\\n}; |
6
- | tst.js:17:1 :17:9 | Fixture | tst.js:18:1:22:2 | Test.xU ... ..]\\n\\n}; |
6
+ | tst.js:17:2 :17:8 | Fixture | tst.js:18:1:22:2 | Test.xU ... ..]\\n\\n}; |
7
7
| tst.js:24:1:24:9 | [Fixture] | tst.js:25:1:34:2 | Test.Ex ... }\\n}; |
8
8
| tst.js:27:5:29:7 | [Import ... })] | tst.js:31:5:33:5 | functio ... ]\\n } |
9
- | tst.js:30:5 :30:10 | Fact | tst.js:31:5:33:5 | functio ... ]\\n } |
9
+ | tst.js:30:6 :30:9 | Fact | tst.js:31:5:33:5 | functio ... ]\\n } |
10
10
xUnitAttribute
11
11
| tst.js:3:2:3:8 | Fixture | Fixture | 0 |
12
12
| tst.js:5:6:5:12 | Fixture | Fixture | 0 |
@@ -24,7 +24,7 @@ xUnitFixture
24
24
| tst.js:4:20:14:1 | functio ... }\\n} | tst.js:3:1:3:9 | [Fixture] |
25
25
| tst.js:6:5:13:5 | functio ... }\\n } | tst.js:5:5:5:13 | [Fixture] |
26
26
| tst.js:18:24:22:1 | functio ... ...]\\n\\n} | tst.js:16:1:16:43 | [Import ... t.js")] |
27
- | tst.js:18:24:22:1 | functio ... ...]\\n\\n} | tst.js:17:1 :17:9 | Fixture |
27
+ | tst.js:18:24:22:1 | functio ... ...]\\n\\n} | tst.js:17:2 :17:8 | Fixture |
28
28
| tst.js:25:21:34:1 | functio ... }\\n} | tst.js:24:1:24:9 | [Fixture] |
29
29
xUnitTarget
30
30
| tst.js:4:1:14:2 | Test.Ex ... }\\n}; |
You can’t perform that action at this time.
0 commit comments