Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fac620d

Browse files
authored
Merge pull request #1357 from asger-semmle/jump-to-namespace
Approved by xiemaisi
2 parents 64aa111 + 153e778 commit fac620d

2 files changed

Lines changed: 1 addition & 9 deletions

File tree

javascript/ql/src/definitions.ql

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -123,20 +123,14 @@ predicate propertyLookup(Expr prop, ASTNode write, string kind) {
123123
}
124124

125125
/**
126-
* Holds if `ref` is an identifier that refers to a type or namespace declared at `decl`.
126+
* Holds if `ref` is an identifier that refers to a type declared at `decl`.
127127
*/
128128
predicate typeLookup(ASTNode ref, ASTNode decl, string kind) {
129129
exists(TypeAccess typeAccess |
130130
ref = typeAccess.getIdentifier() and
131131
decl = typeAccess.getTypeName().getADefinition() and
132132
kind = "T"
133133
)
134-
or
135-
exists(NamespaceAccess namespaceAccess |
136-
ref = namespaceAccess.getIdentifier() and
137-
decl = namespaceAccess.getNamespace().getADefinition() and
138-
kind = "T"
139-
)
140134
}
141135

142136
/**

javascript/ql/test/query-tests/definitions/definitions.expected

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@
55
| client.ts:7:19:7:19 | C | tslib.ts:1:8:3:1 | class C {\\n m() {}\\n} | T |
66
| client.ts:8:10:8:10 | C | client.ts:3:1:5:1 | class C {\\n m() {}\\n} | T |
77
| client.ts:9:16:9:16 | C | client.ts:3:1:5:1 | class C {\\n m() {}\\n} | T |
8-
| client.ts:10:14:10:14 | N | tslib.ts:5:8:9:1 | namespa ... }\\n }\\n} | T |
98
| client.ts:10:16:10:16 | C | tslib.ts:6:10:8:3 | class C ... {}\\n } | T |
109
| client.ts:13:25:13:25 | C | client.ts:3:1:5:1 | class C {\\n m() {}\\n} | T |
1110
| client.ts:13:35:13:35 | C | tslib.ts:1:8:3:1 | class C {\\n m() {}\\n} | T |
12-
| client.ts:13:45:13:45 | N | tslib.ts:5:8:9:1 | namespa ... }\\n }\\n} | T |
1311
| client.ts:13:47:13:47 | C | tslib.ts:6:10:8:3 | class C ... {}\\n } | T |
1412
| client.ts:14:3:14:3 | x | client.ts:13:22:13:22 | x | V |
1513
| client.ts:14:5:14:5 | m | client.ts:4:3:4:8 | m() {} | M |

0 commit comments

Comments
 (0)