Skip to content

Commit cf8c327

Browse files
committed
JS: make TypeAnnotation extend Locatable
1 parent c44f99a commit cf8c327

File tree

3 files changed

+17
-20
lines changed

3 files changed

+17
-20
lines changed

javascript/ql/src/semmle/javascript/TypeAnnotations.qll

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@ import javascript
77
/**
88
* A type annotation, either in the form of a TypeScript type or a JSDoc comment.
99
*/
10-
class TypeAnnotation extends @type_annotation {
11-
/** Gets a string representation of this type. */
12-
string toString() { none() }
13-
10+
class TypeAnnotation extends @type_annotation, Locatable {
1411
/** Holds if this is the `any` type. */
1512
predicate isAny() { none() }
1613

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
test_isString
2-
| string |
2+
| file://:0:0:0:0 | string |
33
test_isNumber
4-
| number |
4+
| file://:0:0:0:0 | number |
55
test_QualifiedName
6-
| VarType | VarType |
7-
| boolean | boolean |
8-
| foo.bar.baz | foo.bar.baz |
9-
| number | number |
10-
| string | string |
6+
| VarType | file://:0:0:0:0 | VarType |
7+
| boolean | file://:0:0:0:0 | boolean |
8+
| foo.bar.baz | file://:0:0:0:0 | foo.bar.baz |
9+
| number | file://:0:0:0:0 | number |
10+
| string | file://:0:0:0:0 | string |
1111
test_ParameterType
12-
| tst.js:7:12:7:12 | x | string |
13-
| tst.js:7:15:7:15 | y | number? |
14-
| tst.js:7:18:7:18 | z | foo.bar.baz |
12+
| tst.js:7:12:7:12 | x | file://:0:0:0:0 | string |
13+
| tst.js:7:15:7:15 | y | file://:0:0:0:0 | number? |
14+
| tst.js:7:18:7:18 | z | file://:0:0:0:0 | foo.bar.baz |
1515
test_VarType
16-
| tst.js:7:12:7:12 | x | string |
17-
| tst.js:7:15:7:15 | y | number? |
18-
| tst.js:7:18:7:18 | z | foo.bar.baz |
19-
| tst.js:11:7:11:7 | w | VarType |
16+
| tst.js:7:12:7:12 | x | file://:0:0:0:0 | string |
17+
| tst.js:7:15:7:15 | y | file://:0:0:0:0 | number? |
18+
| tst.js:7:18:7:18 | z | file://:0:0:0:0 | foo.bar.baz |
19+
| tst.js:11:7:11:7 | w | file://:0:0:0:0 | VarType |
2020
test_ReturnType
21-
| tst.js:7:1:12:1 | functio ... null;\\n} | boolean |
21+
| tst.js:7:1:12:1 | functio ... null;\\n} | file://:0:0:0:0 | boolean |
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
| ResolvedType | resolved | ResolvedType |
1+
| tst.ts:5:8:5:19 | ResolvedType | resolved | ResolvedType |

0 commit comments

Comments
 (0)